├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── newsapi ├── Cargo.toml └── src │ └── lib.rs └── src ├── main.rs └── theme.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | */*/target -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "autocfg" 7 | version = "1.0.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 10 | 11 | [[package]] 12 | name = "base64" 13 | version = "0.13.0" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 16 | 17 | [[package]] 18 | name = "bitflags" 19 | version = "1.3.1" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1" 22 | 23 | [[package]] 24 | name = "bumpalo" 25 | version = "3.7.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" 28 | 29 | [[package]] 30 | name = "bytes" 31 | version = "1.1.0" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 34 | 35 | [[package]] 36 | name = "cc" 37 | version = "1.0.69" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" 40 | 41 | [[package]] 42 | name = "cfg-if" 43 | version = "1.0.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 46 | 47 | [[package]] 48 | name = "chunked_transfer" 49 | version = "1.4.0" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" 52 | 53 | [[package]] 54 | name = "clinews" 55 | version = "0.1.0" 56 | dependencies = [ 57 | "crossterm", 58 | "dotenv", 59 | "newsapi", 60 | "termimad", 61 | "tokio", 62 | ] 63 | 64 | [[package]] 65 | name = "core-foundation" 66 | version = "0.9.1" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 69 | dependencies = [ 70 | "core-foundation-sys", 71 | "libc", 72 | ] 73 | 74 | [[package]] 75 | name = "core-foundation-sys" 76 | version = "0.8.2" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 79 | 80 | [[package]] 81 | name = "crossbeam" 82 | version = "0.8.1" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" 85 | dependencies = [ 86 | "cfg-if", 87 | "crossbeam-channel", 88 | "crossbeam-deque", 89 | "crossbeam-epoch", 90 | "crossbeam-queue", 91 | "crossbeam-utils", 92 | ] 93 | 94 | [[package]] 95 | name = "crossbeam-channel" 96 | version = "0.5.1" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" 99 | dependencies = [ 100 | "cfg-if", 101 | "crossbeam-utils", 102 | ] 103 | 104 | [[package]] 105 | name = "crossbeam-deque" 106 | version = "0.8.1" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" 109 | dependencies = [ 110 | "cfg-if", 111 | "crossbeam-epoch", 112 | "crossbeam-utils", 113 | ] 114 | 115 | [[package]] 116 | name = "crossbeam-epoch" 117 | version = "0.9.5" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" 120 | dependencies = [ 121 | "cfg-if", 122 | "crossbeam-utils", 123 | "lazy_static", 124 | "memoffset", 125 | "scopeguard", 126 | ] 127 | 128 | [[package]] 129 | name = "crossbeam-queue" 130 | version = "0.3.2" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" 133 | dependencies = [ 134 | "cfg-if", 135 | "crossbeam-utils", 136 | ] 137 | 138 | [[package]] 139 | name = "crossbeam-utils" 140 | version = "0.8.5" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" 143 | dependencies = [ 144 | "cfg-if", 145 | "lazy_static", 146 | ] 147 | 148 | [[package]] 149 | name = "crossterm" 150 | version = "0.20.0" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "c0ebde6a9dd5e331cd6c6f48253254d117642c31653baa475e394657c59c1f7d" 153 | dependencies = [ 154 | "bitflags", 155 | "crossterm_winapi", 156 | "libc", 157 | "mio", 158 | "parking_lot", 159 | "signal-hook", 160 | "signal-hook-mio", 161 | "winapi", 162 | ] 163 | 164 | [[package]] 165 | name = "crossterm_winapi" 166 | version = "0.8.0" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "3a6966607622438301997d3dac0d2f6e9a90c68bb6bc1785ea98456ab93c0507" 169 | dependencies = [ 170 | "winapi", 171 | ] 172 | 173 | [[package]] 174 | name = "dotenv" 175 | version = "0.15.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" 178 | 179 | [[package]] 180 | name = "encoding_rs" 181 | version = "0.8.28" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" 184 | dependencies = [ 185 | "cfg-if", 186 | ] 187 | 188 | [[package]] 189 | name = "fnv" 190 | version = "1.0.7" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 193 | 194 | [[package]] 195 | name = "foreign-types" 196 | version = "0.3.2" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 199 | dependencies = [ 200 | "foreign-types-shared", 201 | ] 202 | 203 | [[package]] 204 | name = "foreign-types-shared" 205 | version = "0.1.1" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 208 | 209 | [[package]] 210 | name = "form_urlencoded" 211 | version = "1.0.1" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 214 | dependencies = [ 215 | "matches", 216 | "percent-encoding", 217 | ] 218 | 219 | [[package]] 220 | name = "futures-channel" 221 | version = "0.3.17" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" 224 | dependencies = [ 225 | "futures-core", 226 | ] 227 | 228 | [[package]] 229 | name = "futures-core" 230 | version = "0.3.17" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" 233 | 234 | [[package]] 235 | name = "futures-sink" 236 | version = "0.3.17" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" 239 | 240 | [[package]] 241 | name = "futures-task" 242 | version = "0.3.17" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" 245 | 246 | [[package]] 247 | name = "futures-util" 248 | version = "0.3.17" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" 251 | dependencies = [ 252 | "autocfg", 253 | "futures-core", 254 | "futures-task", 255 | "pin-project-lite", 256 | "pin-utils", 257 | ] 258 | 259 | [[package]] 260 | name = "getrandom" 261 | version = "0.2.3" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" 264 | dependencies = [ 265 | "cfg-if", 266 | "libc", 267 | "wasi", 268 | ] 269 | 270 | [[package]] 271 | name = "h2" 272 | version = "0.3.4" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" 275 | dependencies = [ 276 | "bytes", 277 | "fnv", 278 | "futures-core", 279 | "futures-sink", 280 | "futures-util", 281 | "http", 282 | "indexmap", 283 | "slab", 284 | "tokio", 285 | "tokio-util", 286 | "tracing", 287 | ] 288 | 289 | [[package]] 290 | name = "hashbrown" 291 | version = "0.11.2" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 294 | 295 | [[package]] 296 | name = "hermit-abi" 297 | version = "0.1.19" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 300 | dependencies = [ 301 | "libc", 302 | ] 303 | 304 | [[package]] 305 | name = "http" 306 | version = "0.2.4" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" 309 | dependencies = [ 310 | "bytes", 311 | "fnv", 312 | "itoa", 313 | ] 314 | 315 | [[package]] 316 | name = "http-body" 317 | version = "0.4.3" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" 320 | dependencies = [ 321 | "bytes", 322 | "http", 323 | "pin-project-lite", 324 | ] 325 | 326 | [[package]] 327 | name = "httparse" 328 | version = "1.5.1" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" 331 | 332 | [[package]] 333 | name = "httpdate" 334 | version = "1.0.1" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" 337 | 338 | [[package]] 339 | name = "hyper" 340 | version = "0.14.13" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" 343 | dependencies = [ 344 | "bytes", 345 | "futures-channel", 346 | "futures-core", 347 | "futures-util", 348 | "h2", 349 | "http", 350 | "http-body", 351 | "httparse", 352 | "httpdate", 353 | "itoa", 354 | "pin-project-lite", 355 | "socket2", 356 | "tokio", 357 | "tower-service", 358 | "tracing", 359 | "want", 360 | ] 361 | 362 | [[package]] 363 | name = "hyper-tls" 364 | version = "0.5.0" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 367 | dependencies = [ 368 | "bytes", 369 | "hyper", 370 | "native-tls", 371 | "tokio", 372 | "tokio-native-tls", 373 | ] 374 | 375 | [[package]] 376 | name = "idna" 377 | version = "0.2.3" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 380 | dependencies = [ 381 | "matches", 382 | "unicode-bidi", 383 | "unicode-normalization", 384 | ] 385 | 386 | [[package]] 387 | name = "indexmap" 388 | version = "1.7.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" 391 | dependencies = [ 392 | "autocfg", 393 | "hashbrown", 394 | ] 395 | 396 | [[package]] 397 | name = "instant" 398 | version = "0.1.10" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" 401 | dependencies = [ 402 | "cfg-if", 403 | ] 404 | 405 | [[package]] 406 | name = "ipnet" 407 | version = "2.3.1" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" 410 | 411 | [[package]] 412 | name = "itoa" 413 | version = "0.4.7" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" 416 | 417 | [[package]] 418 | name = "js-sys" 419 | version = "0.3.52" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "ce791b7ca6638aae45be056e068fc756d871eb3b3b10b8efa62d1c9cec616752" 422 | dependencies = [ 423 | "wasm-bindgen", 424 | ] 425 | 426 | [[package]] 427 | name = "lazy_static" 428 | version = "1.4.0" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 431 | 432 | [[package]] 433 | name = "libc" 434 | version = "0.2.102" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" 437 | 438 | [[package]] 439 | name = "lock_api" 440 | version = "0.4.4" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" 443 | dependencies = [ 444 | "scopeguard", 445 | ] 446 | 447 | [[package]] 448 | name = "log" 449 | version = "0.4.14" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 452 | dependencies = [ 453 | "cfg-if", 454 | ] 455 | 456 | [[package]] 457 | name = "matches" 458 | version = "0.1.9" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 461 | 462 | [[package]] 463 | name = "memchr" 464 | version = "2.4.1" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 467 | 468 | [[package]] 469 | name = "memoffset" 470 | version = "0.6.4" 471 | source = "registry+https://github.com/rust-lang/crates.io-index" 472 | checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" 473 | dependencies = [ 474 | "autocfg", 475 | ] 476 | 477 | [[package]] 478 | name = "mime" 479 | version = "0.3.16" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 482 | 483 | [[package]] 484 | name = "minimad" 485 | version = "0.8.0" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "8957f240ecb82a4e699bcf4db189fe8a7f5aa68b9e6d5abf829c62a9ee4630ed" 488 | dependencies = [ 489 | "once_cell", 490 | ] 491 | 492 | [[package]] 493 | name = "mio" 494 | version = "0.7.13" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" 497 | dependencies = [ 498 | "libc", 499 | "log", 500 | "miow", 501 | "ntapi", 502 | "winapi", 503 | ] 504 | 505 | [[package]] 506 | name = "miow" 507 | version = "0.3.7" 508 | source = "registry+https://github.com/rust-lang/crates.io-index" 509 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 510 | dependencies = [ 511 | "winapi", 512 | ] 513 | 514 | [[package]] 515 | name = "native-tls" 516 | version = "0.2.8" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" 519 | dependencies = [ 520 | "lazy_static", 521 | "libc", 522 | "log", 523 | "openssl", 524 | "openssl-probe", 525 | "openssl-sys", 526 | "schannel", 527 | "security-framework", 528 | "security-framework-sys", 529 | "tempfile", 530 | ] 531 | 532 | [[package]] 533 | name = "newsapi" 534 | version = "0.1.0" 535 | dependencies = [ 536 | "reqwest", 537 | "serde", 538 | "serde_json", 539 | "thiserror", 540 | "ureq", 541 | "url", 542 | ] 543 | 544 | [[package]] 545 | name = "ntapi" 546 | version = "0.3.6" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 549 | dependencies = [ 550 | "winapi", 551 | ] 552 | 553 | [[package]] 554 | name = "num_cpus" 555 | version = "1.13.0" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 558 | dependencies = [ 559 | "hermit-abi", 560 | "libc", 561 | ] 562 | 563 | [[package]] 564 | name = "once_cell" 565 | version = "1.8.0" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 568 | 569 | [[package]] 570 | name = "openssl" 571 | version = "0.10.36" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" 574 | dependencies = [ 575 | "bitflags", 576 | "cfg-if", 577 | "foreign-types", 578 | "libc", 579 | "once_cell", 580 | "openssl-sys", 581 | ] 582 | 583 | [[package]] 584 | name = "openssl-probe" 585 | version = "0.1.4" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" 588 | 589 | [[package]] 590 | name = "openssl-sys" 591 | version = "0.9.66" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82" 594 | dependencies = [ 595 | "autocfg", 596 | "cc", 597 | "libc", 598 | "pkg-config", 599 | "vcpkg", 600 | ] 601 | 602 | [[package]] 603 | name = "parking_lot" 604 | version = "0.11.1" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 607 | dependencies = [ 608 | "instant", 609 | "lock_api", 610 | "parking_lot_core", 611 | ] 612 | 613 | [[package]] 614 | name = "parking_lot_core" 615 | version = "0.8.3" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" 618 | dependencies = [ 619 | "cfg-if", 620 | "instant", 621 | "libc", 622 | "redox_syscall", 623 | "smallvec", 624 | "winapi", 625 | ] 626 | 627 | [[package]] 628 | name = "percent-encoding" 629 | version = "2.1.0" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 632 | 633 | [[package]] 634 | name = "pin-project-lite" 635 | version = "0.2.7" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" 638 | 639 | [[package]] 640 | name = "pin-utils" 641 | version = "0.1.0" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 644 | 645 | [[package]] 646 | name = "pkg-config" 647 | version = "0.3.19" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 650 | 651 | [[package]] 652 | name = "ppv-lite86" 653 | version = "0.2.10" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 656 | 657 | [[package]] 658 | name = "proc-macro2" 659 | version = "1.0.28" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" 662 | dependencies = [ 663 | "unicode-xid", 664 | ] 665 | 666 | [[package]] 667 | name = "quote" 668 | version = "1.0.9" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 671 | dependencies = [ 672 | "proc-macro2", 673 | ] 674 | 675 | [[package]] 676 | name = "rand" 677 | version = "0.8.4" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" 680 | dependencies = [ 681 | "libc", 682 | "rand_chacha", 683 | "rand_core", 684 | "rand_hc", 685 | ] 686 | 687 | [[package]] 688 | name = "rand_chacha" 689 | version = "0.3.1" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 692 | dependencies = [ 693 | "ppv-lite86", 694 | "rand_core", 695 | ] 696 | 697 | [[package]] 698 | name = "rand_core" 699 | version = "0.6.3" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 702 | dependencies = [ 703 | "getrandom", 704 | ] 705 | 706 | [[package]] 707 | name = "rand_hc" 708 | version = "0.3.1" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" 711 | dependencies = [ 712 | "rand_core", 713 | ] 714 | 715 | [[package]] 716 | name = "redox_syscall" 717 | version = "0.2.10" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 720 | dependencies = [ 721 | "bitflags", 722 | ] 723 | 724 | [[package]] 725 | name = "remove_dir_all" 726 | version = "0.5.3" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 729 | dependencies = [ 730 | "winapi", 731 | ] 732 | 733 | [[package]] 734 | name = "reqwest" 735 | version = "0.11.4" 736 | source = "registry+https://github.com/rust-lang/crates.io-index" 737 | checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" 738 | dependencies = [ 739 | "base64", 740 | "bytes", 741 | "encoding_rs", 742 | "futures-core", 743 | "futures-util", 744 | "http", 745 | "http-body", 746 | "hyper", 747 | "hyper-tls", 748 | "ipnet", 749 | "js-sys", 750 | "lazy_static", 751 | "log", 752 | "mime", 753 | "native-tls", 754 | "percent-encoding", 755 | "pin-project-lite", 756 | "serde", 757 | "serde_json", 758 | "serde_urlencoded", 759 | "tokio", 760 | "tokio-native-tls", 761 | "url", 762 | "wasm-bindgen", 763 | "wasm-bindgen-futures", 764 | "web-sys", 765 | "winreg", 766 | ] 767 | 768 | [[package]] 769 | name = "ring" 770 | version = "0.16.20" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 773 | dependencies = [ 774 | "cc", 775 | "libc", 776 | "once_cell", 777 | "spin", 778 | "untrusted", 779 | "web-sys", 780 | "winapi", 781 | ] 782 | 783 | [[package]] 784 | name = "rustls" 785 | version = "0.19.1" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" 788 | dependencies = [ 789 | "base64", 790 | "log", 791 | "ring", 792 | "sct", 793 | "webpki", 794 | ] 795 | 796 | [[package]] 797 | name = "ryu" 798 | version = "1.0.5" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 801 | 802 | [[package]] 803 | name = "schannel" 804 | version = "0.1.19" 805 | source = "registry+https://github.com/rust-lang/crates.io-index" 806 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 807 | dependencies = [ 808 | "lazy_static", 809 | "winapi", 810 | ] 811 | 812 | [[package]] 813 | name = "scopeguard" 814 | version = "1.1.0" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 817 | 818 | [[package]] 819 | name = "sct" 820 | version = "0.6.1" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" 823 | dependencies = [ 824 | "ring", 825 | "untrusted", 826 | ] 827 | 828 | [[package]] 829 | name = "security-framework" 830 | version = "2.3.1" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" 833 | dependencies = [ 834 | "bitflags", 835 | "core-foundation", 836 | "core-foundation-sys", 837 | "libc", 838 | "security-framework-sys", 839 | ] 840 | 841 | [[package]] 842 | name = "security-framework-sys" 843 | version = "2.4.2" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" 846 | dependencies = [ 847 | "core-foundation-sys", 848 | "libc", 849 | ] 850 | 851 | [[package]] 852 | name = "serde" 853 | version = "1.0.127" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" 856 | dependencies = [ 857 | "serde_derive", 858 | ] 859 | 860 | [[package]] 861 | name = "serde_derive" 862 | version = "1.0.127" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" 865 | dependencies = [ 866 | "proc-macro2", 867 | "quote", 868 | "syn", 869 | ] 870 | 871 | [[package]] 872 | name = "serde_json" 873 | version = "1.0.66" 874 | source = "registry+https://github.com/rust-lang/crates.io-index" 875 | checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" 876 | dependencies = [ 877 | "itoa", 878 | "ryu", 879 | "serde", 880 | ] 881 | 882 | [[package]] 883 | name = "serde_urlencoded" 884 | version = "0.7.0" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" 887 | dependencies = [ 888 | "form_urlencoded", 889 | "itoa", 890 | "ryu", 891 | "serde", 892 | ] 893 | 894 | [[package]] 895 | name = "signal-hook" 896 | version = "0.3.9" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" 899 | dependencies = [ 900 | "libc", 901 | "signal-hook-registry", 902 | ] 903 | 904 | [[package]] 905 | name = "signal-hook-mio" 906 | version = "0.2.1" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "29fd5867f1c4f2c5be079aee7a2adf1152ebb04a4bc4d341f504b7dece607ed4" 909 | dependencies = [ 910 | "libc", 911 | "mio", 912 | "signal-hook", 913 | ] 914 | 915 | [[package]] 916 | name = "signal-hook-registry" 917 | version = "1.4.0" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 920 | dependencies = [ 921 | "libc", 922 | ] 923 | 924 | [[package]] 925 | name = "slab" 926 | version = "0.4.4" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" 929 | 930 | [[package]] 931 | name = "smallvec" 932 | version = "1.6.1" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" 935 | 936 | [[package]] 937 | name = "socket2" 938 | version = "0.4.2" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" 941 | dependencies = [ 942 | "libc", 943 | "winapi", 944 | ] 945 | 946 | [[package]] 947 | name = "spin" 948 | version = "0.5.2" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 951 | 952 | [[package]] 953 | name = "syn" 954 | version = "1.0.74" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" 957 | dependencies = [ 958 | "proc-macro2", 959 | "quote", 960 | "unicode-xid", 961 | ] 962 | 963 | [[package]] 964 | name = "tempfile" 965 | version = "3.2.0" 966 | source = "registry+https://github.com/rust-lang/crates.io-index" 967 | checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" 968 | dependencies = [ 969 | "cfg-if", 970 | "libc", 971 | "rand", 972 | "redox_syscall", 973 | "remove_dir_all", 974 | "winapi", 975 | ] 976 | 977 | [[package]] 978 | name = "termimad" 979 | version = "0.14.3" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "d1ea6e542eaec310898d8ba84e5dbda91e95b27e5e023722f0140ca57d72136e" 982 | dependencies = [ 983 | "crossbeam", 984 | "crossterm", 985 | "minimad", 986 | "thiserror", 987 | "unicode-width", 988 | ] 989 | 990 | [[package]] 991 | name = "thiserror" 992 | version = "1.0.26" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" 995 | dependencies = [ 996 | "thiserror-impl", 997 | ] 998 | 999 | [[package]] 1000 | name = "thiserror-impl" 1001 | version = "1.0.26" 1002 | source = "registry+https://github.com/rust-lang/crates.io-index" 1003 | checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" 1004 | dependencies = [ 1005 | "proc-macro2", 1006 | "quote", 1007 | "syn", 1008 | ] 1009 | 1010 | [[package]] 1011 | name = "tinyvec" 1012 | version = "1.3.1" 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" 1014 | checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" 1015 | dependencies = [ 1016 | "tinyvec_macros", 1017 | ] 1018 | 1019 | [[package]] 1020 | name = "tinyvec_macros" 1021 | version = "0.1.0" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1024 | 1025 | [[package]] 1026 | name = "tokio" 1027 | version = "1.11.0" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "b4efe6fc2395938c8155973d7be49fe8d03a843726e285e100a8a383cc0154ce" 1030 | dependencies = [ 1031 | "autocfg", 1032 | "bytes", 1033 | "libc", 1034 | "memchr", 1035 | "mio", 1036 | "num_cpus", 1037 | "once_cell", 1038 | "parking_lot", 1039 | "pin-project-lite", 1040 | "signal-hook-registry", 1041 | "tokio-macros", 1042 | "winapi", 1043 | ] 1044 | 1045 | [[package]] 1046 | name = "tokio-macros" 1047 | version = "1.3.0" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" 1050 | dependencies = [ 1051 | "proc-macro2", 1052 | "quote", 1053 | "syn", 1054 | ] 1055 | 1056 | [[package]] 1057 | name = "tokio-native-tls" 1058 | version = "0.3.0" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 1061 | dependencies = [ 1062 | "native-tls", 1063 | "tokio", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "tokio-util" 1068 | version = "0.6.8" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" 1071 | dependencies = [ 1072 | "bytes", 1073 | "futures-core", 1074 | "futures-sink", 1075 | "log", 1076 | "pin-project-lite", 1077 | "tokio", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "tower-service" 1082 | version = "0.3.1" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" 1085 | 1086 | [[package]] 1087 | name = "tracing" 1088 | version = "0.1.28" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" 1091 | dependencies = [ 1092 | "cfg-if", 1093 | "pin-project-lite", 1094 | "tracing-core", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "tracing-core" 1099 | version = "0.1.20" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" 1102 | dependencies = [ 1103 | "lazy_static", 1104 | ] 1105 | 1106 | [[package]] 1107 | name = "try-lock" 1108 | version = "0.2.3" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1111 | 1112 | [[package]] 1113 | name = "unicode-bidi" 1114 | version = "0.3.6" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" 1117 | 1118 | [[package]] 1119 | name = "unicode-normalization" 1120 | version = "0.1.19" 1121 | source = "registry+https://github.com/rust-lang/crates.io-index" 1122 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1123 | dependencies = [ 1124 | "tinyvec", 1125 | ] 1126 | 1127 | [[package]] 1128 | name = "unicode-width" 1129 | version = "0.1.8" 1130 | source = "registry+https://github.com/rust-lang/crates.io-index" 1131 | checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" 1132 | 1133 | [[package]] 1134 | name = "unicode-xid" 1135 | version = "0.2.2" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1138 | 1139 | [[package]] 1140 | name = "untrusted" 1141 | version = "0.7.1" 1142 | source = "registry+https://github.com/rust-lang/crates.io-index" 1143 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 1144 | 1145 | [[package]] 1146 | name = "ureq" 1147 | version = "2.1.1" 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" 1149 | checksum = "2475a6781e9bc546e7b64f4013d2f4032c8c6a40fcffd7c6f4ee734a890972ab" 1150 | dependencies = [ 1151 | "base64", 1152 | "chunked_transfer", 1153 | "log", 1154 | "once_cell", 1155 | "rustls", 1156 | "serde", 1157 | "serde_json", 1158 | "url", 1159 | "webpki", 1160 | "webpki-roots", 1161 | ] 1162 | 1163 | [[package]] 1164 | name = "url" 1165 | version = "2.2.2" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1168 | dependencies = [ 1169 | "form_urlencoded", 1170 | "idna", 1171 | "matches", 1172 | "percent-encoding", 1173 | ] 1174 | 1175 | [[package]] 1176 | name = "vcpkg" 1177 | version = "0.2.15" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1180 | 1181 | [[package]] 1182 | name = "want" 1183 | version = "0.3.0" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1186 | dependencies = [ 1187 | "log", 1188 | "try-lock", 1189 | ] 1190 | 1191 | [[package]] 1192 | name = "wasi" 1193 | version = "0.10.2+wasi-snapshot-preview1" 1194 | source = "registry+https://github.com/rust-lang/crates.io-index" 1195 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1196 | 1197 | [[package]] 1198 | name = "wasm-bindgen" 1199 | version = "0.2.75" 1200 | source = "registry+https://github.com/rust-lang/crates.io-index" 1201 | checksum = "b608ecc8f4198fe8680e2ed18eccab5f0cd4caaf3d83516fa5fb2e927fda2586" 1202 | dependencies = [ 1203 | "cfg-if", 1204 | "serde", 1205 | "serde_json", 1206 | "wasm-bindgen-macro", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "wasm-bindgen-backend" 1211 | version = "0.2.75" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "580aa3a91a63d23aac5b6b267e2d13cb4f363e31dce6c352fca4752ae12e479f" 1214 | dependencies = [ 1215 | "bumpalo", 1216 | "lazy_static", 1217 | "log", 1218 | "proc-macro2", 1219 | "quote", 1220 | "syn", 1221 | "wasm-bindgen-shared", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "wasm-bindgen-futures" 1226 | version = "0.4.25" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "16646b21c3add8e13fdb8f20172f8a28c3dbf62f45406bcff0233188226cfe0c" 1229 | dependencies = [ 1230 | "cfg-if", 1231 | "js-sys", 1232 | "wasm-bindgen", 1233 | "web-sys", 1234 | ] 1235 | 1236 | [[package]] 1237 | name = "wasm-bindgen-macro" 1238 | version = "0.2.75" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c" 1241 | dependencies = [ 1242 | "quote", 1243 | "wasm-bindgen-macro-support", 1244 | ] 1245 | 1246 | [[package]] 1247 | name = "wasm-bindgen-macro-support" 1248 | version = "0.2.75" 1249 | source = "registry+https://github.com/rust-lang/crates.io-index" 1250 | checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f" 1251 | dependencies = [ 1252 | "proc-macro2", 1253 | "quote", 1254 | "syn", 1255 | "wasm-bindgen-backend", 1256 | "wasm-bindgen-shared", 1257 | ] 1258 | 1259 | [[package]] 1260 | name = "wasm-bindgen-shared" 1261 | version = "0.2.75" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "2e0c4a743a309662d45f4ede961d7afa4ba4131a59a639f29b0069c3798bbcc2" 1264 | 1265 | [[package]] 1266 | name = "web-sys" 1267 | version = "0.3.52" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "01c70a82d842c9979078c772d4a1344685045f1a5628f677c2b2eab4dd7d2696" 1270 | dependencies = [ 1271 | "js-sys", 1272 | "wasm-bindgen", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "webpki" 1277 | version = "0.21.4" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" 1280 | dependencies = [ 1281 | "ring", 1282 | "untrusted", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "webpki-roots" 1287 | version = "0.21.1" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" 1290 | dependencies = [ 1291 | "webpki", 1292 | ] 1293 | 1294 | [[package]] 1295 | name = "winapi" 1296 | version = "0.3.9" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1299 | dependencies = [ 1300 | "winapi-i686-pc-windows-gnu", 1301 | "winapi-x86_64-pc-windows-gnu", 1302 | ] 1303 | 1304 | [[package]] 1305 | name = "winapi-i686-pc-windows-gnu" 1306 | version = "0.4.0" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1309 | 1310 | [[package]] 1311 | name = "winapi-x86_64-pc-windows-gnu" 1312 | version = "0.4.0" 1313 | source = "registry+https://github.com/rust-lang/crates.io-index" 1314 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1315 | 1316 | [[package]] 1317 | name = "winreg" 1318 | version = "0.7.0" 1319 | source = "registry+https://github.com/rust-lang/crates.io-index" 1320 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1321 | dependencies = [ 1322 | "winapi", 1323 | ] 1324 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "clinews" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | description = "A simple cli news reader app" 7 | license = "MIT" 8 | authors = ["creativcoder"] 9 | 10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 11 | 12 | [dependencies] 13 | crossterm = "0.20.0" 14 | dotenv = "0.15.0" 15 | newsapi = { path = "./newsapi", features = ["async"] } 16 | termimad = "0.14.2" 17 | tokio = {version = "1.11.0", features = ["full"] } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Clinews 3 | 4 | A simple cli news reader app in Rust. 5 | 6 | ## Video walkthrough 7 | 8 | 1. [Building a CLI app in Rust](https://www.youtube.com/watch?v=4km2UijVC3M) 9 | 10 | 2. [Refactoring the CLI app in Rust](https://www.youtube.com/watch?v=LHPV3z9OSic) 11 | 12 | 3. [Library API design overhaul, async and more](https://youtu.be/J_yGWdgeGQM) 13 | 14 | ## How to install 15 | 16 | #### Ubuntu 17 | 18 | Install the cargo-deb subcommand: 19 | `cargo install cargo-deb` 20 | 21 | generate a deb package by running: 22 | 23 | `cargo deb` in clinews repository 24 | 25 | install the .deb package from target/debian using `dpkg -i ` 26 | 27 | 28 | #### Other linux distribution 29 | 30 | `cargo install --path .` - You will need rust toolchain setup for this. 31 | 32 | ## Running clinews 33 | 34 | Register on newsapi.org and get an API key. 35 | 36 | Set the API key in your `.bashrc` or `.zshrc` like: 37 | 38 | ```bash 39 | export API_KEY=xxx 40 | ``` 41 | 42 | then 43 | 44 | Run `clinews` from terminal. 45 | 46 | ## Contributions 47 | 48 | Feel free to file issues and PRs 49 | -------------------------------------------------------------------------------- /newsapi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "newsapi" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | ureq = { version = "2.1.1", features = ["json"] } 10 | serde = {version = "1.0.127", features = ["derive"] } 11 | serde_json = "1.0.66" 12 | thiserror = "1.0.26" 13 | url = "2.2.2" 14 | reqwest = {version = "0.11.4", features = ["json"], optional = true } 15 | 16 | [features] 17 | async = [ 18 | "reqwest" 19 | ] 20 | -------------------------------------------------------------------------------- /newsapi/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "async")] 2 | use reqwest::Method; 3 | use serde::Deserialize; 4 | use url::Url; 5 | 6 | const BASE_URL: &str = "https://newsapi.org/v2"; 7 | 8 | #[derive(thiserror::Error, Debug)] 9 | #[non_exhaustive] 10 | pub enum NewsApiError { 11 | #[error("Failed fetching articles")] 12 | RequestFailed(#[from] ureq::Error), 13 | #[error("Failed converting response to string")] 14 | FailedResponseToString(#[from] std::io::Error), 15 | #[error("Article Parsing failed")] 16 | ArticleParseFailed(#[from] serde_json::Error), 17 | #[error("Url parsing failed")] 18 | UrlParsing(#[from] url::ParseError), 19 | #[error("Request failed: {0}")] 20 | BadRequest(&'static str), 21 | #[error("Async request failed")] 22 | #[cfg(feature = "async")] 23 | AsyncRequestFailed(#[from] reqwest::Error) 24 | } 25 | 26 | #[derive(Deserialize, Debug)] 27 | pub struct NewsAPIResponse { 28 | status: String, 29 | articles: Vec
, 30 | code: Option, 31 | } 32 | 33 | impl NewsAPIResponse { 34 | pub fn articles(&self) -> &Vec
{ 35 | &self.articles 36 | } 37 | } 38 | 39 | #[derive(Deserialize, Debug)] 40 | pub struct Article { 41 | title: String, 42 | url: String, 43 | } 44 | 45 | impl Article { 46 | pub fn title(&self) -> &str { 47 | &self.title 48 | } 49 | 50 | pub fn url(&self) -> &str { 51 | &self.url 52 | } 53 | } 54 | 55 | pub enum Endpoint { 56 | TopHeadlines, 57 | } 58 | 59 | impl ToString for Endpoint { 60 | fn to_string(&self) -> String { 61 | match self { 62 | Self::TopHeadlines => "top-headlines".to_string(), 63 | } 64 | } 65 | } 66 | 67 | pub enum Country { 68 | Us, 69 | } 70 | 71 | impl ToString for Country { 72 | fn to_string(&self) -> String { 73 | match self { 74 | Self::Us => "us".to_string(), 75 | } 76 | } 77 | } 78 | 79 | pub struct NewsAPI { 80 | api_key: String, 81 | endpoint: Endpoint, 82 | country: Country, 83 | } 84 | 85 | impl NewsAPI { 86 | pub fn new(api_key: &str) -> NewsAPI { 87 | NewsAPI { 88 | api_key: api_key.to_string(), 89 | endpoint: Endpoint::TopHeadlines, 90 | country: Country::Us, 91 | } 92 | } 93 | 94 | pub fn endpoint(&mut self, endpoint: Endpoint) -> &mut NewsAPI { 95 | self.endpoint = endpoint; 96 | self 97 | } 98 | 99 | pub fn country(&mut self, country: Country) -> &mut NewsAPI { 100 | self.country = country; 101 | self 102 | } 103 | 104 | fn prepare_url(&self) -> Result { 105 | let mut url = Url::parse(BASE_URL)?; 106 | url.path_segments_mut() 107 | .unwrap() 108 | .push(&self.endpoint.to_string()); 109 | 110 | let country = format!("country={}", self.country.to_string()); 111 | url.set_query(Some(&country)); 112 | 113 | Ok(url.to_string()) 114 | } 115 | 116 | pub fn fetch(&self) -> Result { 117 | let url = self.prepare_url()?; 118 | let req = ureq::get(&url).set("Authorization", &self.api_key); 119 | let response: NewsAPIResponse = req.call()?.into_json()?; 120 | match response.status.as_str() { 121 | "ok" => return Ok(response), 122 | _ => return Err(map_response_err(response.code)), 123 | } 124 | } 125 | 126 | #[cfg(feature = "async")] 127 | pub async fn fetch_async(&self) -> Result { 128 | let url = self.prepare_url()?; 129 | let client = reqwest::Client::new(); 130 | let request = client 131 | .request(Method::GET, url) 132 | .header("Authorization", &self.api_key) 133 | .header("User-Agent", "clinews") 134 | .build() 135 | .map_err(|e| NewsApiError::AsyncRequestFailed(e))?; 136 | 137 | let response: NewsAPIResponse = client 138 | .execute(request) 139 | .await? 140 | .json() 141 | .await 142 | .map_err(|e| NewsApiError::AsyncRequestFailed(e))?; 143 | 144 | match response.status.as_str() { 145 | "ok" => return Ok(response), 146 | _ => return Err(map_response_err(response.code)), 147 | } 148 | } 149 | } 150 | 151 | fn map_response_err(code: Option) -> NewsApiError { 152 | if let Some(code) = code { 153 | match code.as_str() { 154 | "apiKeyDisabled" => NewsApiError::BadRequest("Your API key has been disabled"), 155 | _ => NewsApiError::BadRequest("Unknown error"), 156 | } 157 | } else { 158 | NewsApiError::BadRequest("Unknown error") 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod theme; 2 | 3 | use dotenv::dotenv; 4 | use newsapi::{Article, Country, Endpoint, NewsAPI}; 5 | use std::error::Error; 6 | 7 | fn render_articles(articles: &Vec
) { 8 | let theme = theme::default(); 9 | theme.print_text("# Top headlines\n\n"); 10 | for i in articles { 11 | theme.print_text(&format!("`{}`", i.title())); 12 | theme.print_text(&format!("> *{}*", i.url())); 13 | theme.print_text("---"); 14 | } 15 | } 16 | 17 | #[tokio::main] 18 | async fn main() -> Result<(), Box> { 19 | dotenv().ok(); 20 | 21 | let api_key = std::env::var("API_KEY")?; 22 | 23 | let mut newsapi = NewsAPI::new(&api_key); 24 | newsapi 25 | .endpoint(Endpoint::TopHeadlines) 26 | .country(Country::Us); 27 | 28 | let newsapi_response = newsapi.fetch_async().await?; 29 | render_articles(&newsapi_response.articles()); 30 | 31 | Ok(()) 32 | } 33 | -------------------------------------------------------------------------------- /src/theme.rs: -------------------------------------------------------------------------------- 1 | use crossterm::style::Color::{Rgb, Yellow}; 2 | use termimad::{MadSkin, StyledChar}; 3 | 4 | pub fn default() -> MadSkin { 5 | let mut skin = MadSkin::default(); 6 | skin.bold.set_fg(Yellow); 7 | skin.italic.set_bg(Rgb { 8 | r: 28, 9 | g: 28, 10 | b: 28, 11 | }); 12 | skin.bullet = StyledChar::from_fg_char(Yellow, '⟡'); 13 | skin.set_headers_fg(Yellow); 14 | skin.quote_mark = StyledChar::from_fg_char(Yellow, '▐'); 15 | skin.quote_mark.set_fg(Rgb { 16 | r: 215, 17 | g: 255, 18 | b: 135, 19 | }); 20 | skin.inline_code.set_fg(Rgb { 21 | r: 255, 22 | g: 0, 23 | b: 200, 24 | }); 25 | skin.italic.set_fg(Rgb { 26 | r: 215, 27 | g: 255, 28 | b: 0, 29 | }); 30 | 31 | skin 32 | } 33 | --------------------------------------------------------------------------------