From ea3b22fcccc7aecaf28f8005478a1ad957332a30 Mon Sep 17 00:00:00 2001 From: programmer Date: Tue, 11 Oct 2022 16:14:46 +0200 Subject: [PATCH] public API --- Cargo.lock | 657 +++++++++++++++++++-------------- src/bytes.rs | 2 +- src/env.rs | 2 +- src/error.rs | 2 +- src/host_port.rs | 2 +- src/host_port_parse_error.rs | 2 +- src/info.rs | 12 +- src/infohash.rs | 8 +- src/input.rs | 8 +- src/input_target.rs | 4 +- src/lib.rs | 126 +++---- src/magnet_link.rs | 28 +- src/magnet_link_parse_error.rs | 2 +- src/metainfo.rs | 26 +- src/metainfo_error.rs | 2 +- src/sha1_digest.rs | 12 +- src/shell.rs | 2 +- src/torrent_summary.rs | 48 +-- 18 files changed, 520 insertions(+), 425 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69ba787..51e897d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,24 +2,24 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.13.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -107,17 +107,18 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.51" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1931848a574faa8f7c71a12ea00453ff5effbb5f51afe7f77d7a48cace6ac1" +checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" dependencies = [ "addr2line", + "cc", "cfg-if", "libc", "miniz_oxide", @@ -127,9 +128,9 @@ dependencies = [ [[package]] name = "bendy" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f35e865a4aae9618063f67b1cd1ff6d0ae28b9478f1cdc0dd88d61884c8fe71" +checksum = "8133e404c8bec821e531f347dab1247bf64f60882826e7228f8ffeb33a35a658" dependencies = [ "failure", "serde", @@ -138,15 +139,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bstr" -version = "0.2.13" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static", "memchr", @@ -156,15 +157,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "cargo_toml" @@ -179,27 +174,27 @@ dependencies = [ [[package]] name = "cast" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" dependencies = [ "rustc_version", ] [[package]] name = "cc" -version = "1.0.60" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] [[package]] name = "cfg-if" -version = "0.1.10" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" @@ -216,11 +211,11 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "ansi_term 0.11.0", + "ansi_term 0.12.1", "atty", "bitflags", "strsim 0.8.0", @@ -248,10 +243,25 @@ dependencies = [ ] [[package]] -name = "criterion" -version = "0.3.3" +name = "console" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "regex", + "terminal_size", + "unicode-width", + "winapi", +] + +[[package]] +name = "criterion" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" dependencies = [ "atty", "cast", @@ -275,9 +285,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d" +checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" dependencies = [ "cast", "itertools", @@ -285,60 +295,58 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.4.4" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ + "cfg-if", "crossbeam-utils", - "maybe-uninit", ] [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ + "cfg-if", "crossbeam-epoch", "crossbeam-utils", - "maybe-uninit", ] [[package]] name = "crossbeam-epoch" -version = "0.8.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", "lazy_static", - "maybe-uninit", "memoffset", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.7.2" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ - "autocfg", "cfg-if", "lazy_static", ] [[package]] name = "csv" -version = "1.1.3" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", - "itoa", + "itoa 0.4.8", "ryu", "serde", ] @@ -354,9 +362,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.16" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote", "syn", @@ -364,9 +372,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ "darling_core", "darling_macro", @@ -374,23 +382,23 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.9.3", + "strsim 0.10.0", "syn", ] [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", @@ -413,12 +421,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "dtoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" - [[package]] name = "either" version = "1.6.1" @@ -466,6 +468,15 @@ dependencies = [ "synstructure", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "fehler" version = "1.0.0" @@ -492,6 +503,16 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + [[package]] name = "fs_extra" version = "1.2.0" @@ -526,9 +547,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", "libc", @@ -537,15 +558,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.22.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "git2" -version = "0.13.11" +version = "0.13.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e094214efbc7fdbbdee952147e493b00e99a4e52817492277e98967ae918165" +checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6" dependencies = [ "bitflags", "libc", @@ -558,9 +579,9 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120" +checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" dependencies = [ "aho-corasick", "bstr", @@ -571,39 +592,45 @@ dependencies = [ [[package]] name = "half" -version = "1.6.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "humansize" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e" +checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" [[package]] name = "humantime" @@ -622,9 +649,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -633,9 +660,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22dcbf2a4a289528dbef21686354904e1c694ac642610a9bff9e7df730d9ec72" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" dependencies = [ "crossbeam-utils", "globset", @@ -657,7 +684,7 @@ dependencies = [ "atty", "bendy", "chrono", - "console", + "console 0.12.0", "criterion", "globset", "hex", @@ -682,8 +709,8 @@ dependencies = [ "snafu", "static_assertions", "structopt", - "strum 0.19.2", - "strum_macros 0.19.2", + "strum 0.19.5", + "strum_macros 0.19.4", "tempfile", "temptree", "unicode-width", @@ -696,41 +723,66 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cd52c6090487185174be0dc0c3b2ba6e8ea687422d9de66fa244e0bf9339b28" dependencies = [ - "console", + "console 0.15.0", "lazy_static", "number_prefix", "regex", ] [[package]] -name = "itertools" -version = "0.9.0" +name = "indexmap" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "jobserver" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.45" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] @@ -749,15 +801,15 @@ checksum = "441225017b106b9f902e97947a6d31e44ebcf274b91bdbfb51e5c477fcd468e5" [[package]] name = "libc" -version = "0.2.78" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa7087f49d294270db4e1928fc110c976cd4b9e5a16348e0a1df09afa99e6c98" +checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" [[package]] name = "libgit2-sys" -version = "0.12.13+1.0.1" +version = "0.12.26+1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069eea34f76ec15f2822ccf78fe0cdb8c9016764d0a12865278585a74dbdeae5" +checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494" dependencies = [ "cc", "libc", @@ -769,9 +821,9 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.2.19" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" +checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" dependencies = [ "cc", "libc", @@ -783,9 +835,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "92e7e15d7610cce1d9752e137625f14e61a28cd45929b6e12e47b50fe154ee2e" dependencies = [ "cc", "libc", @@ -795,24 +847,24 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "log" -version = "0.4.11" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if", ] [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "maybe-uninit" @@ -828,27 +880,26 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" -version = "0.5.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] [[package]] name = "miniz_oxide" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", - "autocfg", ] [[package]] @@ -869,9 +920,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -879,18 +930,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -904,36 +955,46 @@ checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" [[package]] name = "object" -version = "0.20.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "oorandom" -version = "11.1.2" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "open" -version = "1.4.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c283bf0114efea9e42f1a60edea9859e8c47528eae09d01df4b29c1e489cc48" +checksum = "dcea7a30d6b81a2423cc59c43554880feff7b57d12916f231a79f8d6d9470201" dependencies = [ + "pathdiff", "winapi", ] [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.58" +version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ "autocfg", "cc", @@ -944,13 +1005,19 @@ dependencies = [ [[package]] name = "output_vt100" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" dependencies = [ "winapi", ] +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -959,27 +1026,43 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "plotters" -version = "0.2.15" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" dependencies = [ - "js-sys", "num-traits", + "plotters-backend", + "plotters-svg", "wasm-bindgen", "web-sys", ] [[package]] -name = "ppv-lite86" -version = "0.2.9" +name = "plotters-backend" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" + +[[package]] +name = "plotters-svg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "pretty_assertions" @@ -1029,9 +1112,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] @@ -1044,9 +1127,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.7" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] @@ -1094,9 +1177,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf6960dc9a5b4ee8d3e4c5787b4a112a8818e0290a42ff664ad60692fdf2032" +checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" dependencies = [ "autocfg", "crossbeam-deque", @@ -1106,49 +1189,47 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.8.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c4fec834fb6e6d2dd5eece3c7b432a52f0ba887cf40e595190c4107edc08bf" +checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] [[package]] name = "regex" -version = "1.3.9" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -dependencies = [ - "byteorder", -] +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" @@ -1161,24 +1242,30 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_version" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] -name = "ryu" -version = "1.0.5" +name = "rustversion" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + +[[package]] +name = "ryu" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "same-file" @@ -1197,24 +1284,15 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" -version = "0.9.0" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" [[package]] name = "serde" -version = "1.0.116" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] @@ -1241,9 +1319,9 @@ dependencies = [ [[package]] name = "serde_cbor" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ "half", "serde", @@ -1251,9 +1329,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.116" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -1262,30 +1340,31 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.58" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ - "itoa", + "itoa 1.0.1", "ryu", "serde", ] [[package]] name = "serde_with" -version = "1.5.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87df303fd746404ca055fffb3a1850243ee3404f9bda4dc5760132814dd0734" +checksum = "b827f2113224f3f19a665136f006709194bdfdcb1fdc1e4b2b5cbac8e0cced54" dependencies = [ + "rustversion", "serde", "serde_with_macros", ] [[package]] name = "serde_with_macros" -version = "1.2.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe2c6a4cb9be4c26e73a98dc94fdd90b876971e3b575eeed6d4b82c7d17aa4a5" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling", "proc-macro2", @@ -1295,36 +1374,45 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.13" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3e2dd40a7cdc18ca80db804b7f461a39bb721160a85c9a1fa30134bf3c02a5" +checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" dependencies = [ - "dtoa", - "linked-hash-map", + "indexmap", + "ryu", "serde", "yaml-rust", ] [[package]] name = "sha1" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "smallvec" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ "maybe-uninit", ] [[package]] name = "snafu" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c4e6046e4691afe918fd1b603fd6e515bcda5388a1092a9edbada307d159f09" +checksum = "eab12d3c261b2308b0d80c26fffb58d17eba81a4be97890101f416b478c79ca7" dependencies = [ "doc-comment", "snafu-derive", @@ -1332,9 +1420,9 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7073448732a89f2f3e6581989106067f403d378faeafb4a50812eb814170d3e5" +checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ "proc-macro2", "quote", @@ -1355,15 +1443,15 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "strsim" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "structopt" -version = "0.3.18" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33f6461027d7f08a13715659b2948e1602c31a3756aeae9378bfe7518c72e82" +checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" dependencies = [ "clap", "lazy_static", @@ -1372,9 +1460,9 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.11" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92e775028122a4b3dd55d58f14fc5120289c69bee99df1d117ae30f84b225c9" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", @@ -1391,9 +1479,9 @@ checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" [[package]] name = "strum" -version = "0.19.2" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3924a58d165da3b7b2922c667ab0673c7b5fd52b5c19ea3442747bcb3cd15abe" +checksum = "b89a286a7e3b5720b9a477b23253bc50debac207c8d21505f8e70b36792f11b5" [[package]] name = "strum_macros" @@ -1409,9 +1497,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.19.2" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2ab682ecdcae7f5f45ae85cd7c1e6c8e68ea42c8a612d47fedf831c037146a" +checksum = "e61bb0be289045cb80bfce000512e32d09f8337e54c186725da381377ad1f8d5" dependencies = [ "heck", "proc-macro2", @@ -1421,9 +1509,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.42" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c51d92969d209b54a98397e1b91c8ae82d8c87a7bb87df0b29aa2ad81454228" +checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" dependencies = [ "proc-macro2", "quote", @@ -1432,9 +1520,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", @@ -1444,13 +1532,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", + "fastrand", "libc", - "rand", "redox_syscall", "remove_dir_all", "winapi", @@ -1477,18 +1565,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "terminal_size" -version = "0.1.13" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a14cd9f8c72704232f0bfc8455c0e861f0ad4eb60cc9ec8a170e231414c1e13" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" dependencies = [ "libc", "winapi", @@ -1496,9 +1584,9 @@ dependencies = [ [[package]] name = "termios" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0fcee7b24a25675de40d5bb4de6e41b0df07bc9856295e7e2b3a3600c400c2" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" dependencies = [ "libc", ] @@ -1515,11 +1603,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -1535,9 +1623,9 @@ dependencies = [ [[package]] name = "tinytemplate" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ "serde", "serde_json", @@ -1545,61 +1633,68 @@ dependencies = [ [[package]] name = "tinyvec" -version = "0.3.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" -version = "0.5.6" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "url" -version = "2.1.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ + "form_urlencoded", "idna", "matches", "percent-encoding", @@ -1608,9 +1703,9 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec_map" @@ -1620,15 +1715,15 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi", @@ -1649,9 +1744,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1659,9 +1754,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -1674,9 +1769,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1684,9 +1779,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -1697,15 +1792,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.68" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.45" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -1744,9 +1839,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "yaml-rust" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] diff --git a/src/bytes.rs b/src/bytes.rs index 9212831..f8605df 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -9,7 +9,7 @@ const EI: u64 = PI << 10; #[derive(Debug, PartialEq, Copy, Clone, PartialOrd, Ord, Eq, Serialize, Deserialize, Default)] #[serde(transparent)] -pub(crate) struct Bytes(pub(crate) u64); +pub struct Bytes(pub(crate) u64); impl Bytes { pub(crate) fn kib() -> Self { diff --git a/src/env.rs b/src/env.rs index b6a1efe..4ac7a68 100644 --- a/src/env.rs +++ b/src/env.rs @@ -1,6 +1,6 @@ use crate::common::*; -pub(crate) struct Env { +pub struct Env { args: Vec, dir: PathBuf, input: Box, diff --git a/src/error.rs b/src/error.rs index 9993e7e..34e6889 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,7 +2,7 @@ use crate::common::*; #[derive(Debug, Snafu)] #[snafu(visibility(pub(crate)))] -pub(crate) enum Error { +pub enum Error { #[snafu(display("Failed to parse announce URL: {}", source))] AnnounceUrlParse { source: url::ParseError }, #[snafu(display("Failed to parse byte count `{}`: {}", text, source))] diff --git a/src/host_port.rs b/src/host_port.rs index 48223b9..69d5373 100644 --- a/src/host_port.rs +++ b/src/host_port.rs @@ -1,7 +1,7 @@ use crate::common::*; #[derive(Debug, PartialEq, Clone)] -pub(crate) struct HostPort { +pub struct HostPort { host: Host, port: u16, } diff --git a/src/host_port_parse_error.rs b/src/host_port_parse_error.rs index 1902a9d..8c0bcc7 100644 --- a/src/host_port_parse_error.rs +++ b/src/host_port_parse_error.rs @@ -2,7 +2,7 @@ use crate::common::*; #[derive(Debug, Snafu)] #[snafu(visibility(pub(crate)))] -pub(crate) enum HostPortParseError { +pub enum HostPortParseError { #[snafu(display("Failed to parse host `{}`: {}", text, source))] Host { text: String, diff --git a/src/info.rs b/src/info.rs index e2928c6..29a9d48 100644 --- a/src/info.rs +++ b/src/info.rs @@ -1,22 +1,22 @@ use crate::common::*; #[derive(Deserialize, Serialize, Debug, PartialEq, Clone)] -pub(crate) struct Info { +pub struct Info { #[serde( skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) private: Option, + pub private: Option, #[serde(rename = "piece length")] - pub(crate) piece_length: Bytes, - pub(crate) name: String, + pub piece_length: Bytes, + pub name: String, #[serde( skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) source: Option, + pub source: Option, pub(crate) pieces: PieceList, #[serde(flatten)] pub(crate) mode: Mode, @@ -26,7 +26,7 @@ pub(crate) struct Info { with = "unwrap_or_skip", rename = "update-url" )] - pub(crate) update_url: Option, + pub update_url: Option, } impl Info { diff --git a/src/infohash.rs b/src/infohash.rs index c2d5c73..06ed212 100644 --- a/src/infohash.rs +++ b/src/infohash.rs @@ -1,12 +1,12 @@ use crate::common::*; #[derive(Debug, Eq, PartialEq, Copy, Clone)] -pub(crate) struct Infohash { - inner: Sha1Digest, +pub struct Infohash { + pub inner: Sha1Digest, } impl Infohash { - pub(crate) fn from_input(input: &Input) -> Result { + pub fn from_input(input: &Input) -> Result { let value = Value::from_bencode(input.data()).map_err(|error| Error::MetainfoDecode { input: input.source().clone(), error, @@ -43,7 +43,7 @@ impl Infohash { } } - pub(crate) fn from_bencoded_info_dict(info: &[u8]) -> Infohash { + pub fn from_bencoded_info_dict(info: &[u8]) -> Infohash { Infohash { inner: Sha1Digest::from_data(info), } diff --git a/src/input.rs b/src/input.rs index b3bbdf3..384a94d 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,20 +1,20 @@ use crate::common::*; -pub(crate) struct Input { +pub struct Input { source: InputTarget, data: Vec, } impl Input { - pub(crate) fn new(source: InputTarget, data: Vec) -> Input { + pub fn new(source: InputTarget, data: Vec) -> Input { Self { source, data } } - pub(crate) fn data(&self) -> &[u8] { + pub fn data(&self) -> &[u8] { &self.data } - pub(crate) fn source(&self) -> &InputTarget { + pub fn source(&self) -> &InputTarget { &self.source } diff --git a/src/input_target.rs b/src/input_target.rs index 64e8991..8c7b910 100644 --- a/src/input_target.rs +++ b/src/input_target.rs @@ -1,13 +1,13 @@ use crate::common::*; #[derive(PartialEq, Debug, Clone)] -pub(crate) enum InputTarget { +pub enum InputTarget { Path(PathBuf), Stdin, } impl InputTarget { - pub(crate) fn try_from_os_str(text: &OsStr) -> Result { + pub fn try_from_os_str(text: &OsStr) -> Result { text .try_into() .map_err(|err: Error| OsString::from(err.to_string())) diff --git a/src/lib.rs b/src/lib.rs index 25b15be..41575fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,85 +41,85 @@ #[cfg(test)] #[macro_use] -mod assert_matches; +pub mod assert_matches; #[macro_use] -mod errln; +pub mod errln; #[macro_use] -mod err; +pub mod err; #[macro_use] -mod out; +pub mod out; #[macro_use] -mod outln; +pub mod outln; #[cfg(test)] #[macro_use] -mod test_env; +pub mod test_env; #[cfg(test)] -mod test_env_builder; +pub mod test_env_builder; #[cfg(test)] -mod capture; +pub mod capture; -mod arguments; -mod bytes; -mod common; -mod consts; -mod env; -mod error; -mod file_error; -mod file_info; -mod file_path; -mod file_status; -mod files; -mod hasher; -mod host_port; -mod host_port_parse_error; -mod info; -mod infohash; -mod input; -mod input_stream; -mod input_target; -mod into_u64; -mod into_usize; -mod invariant; -mod lint; -mod linter; -mod magnet_link; -mod magnet_link_parse_error; -mod md5_digest; -mod metainfo; -mod metainfo_error; -mod mode; -mod options; -mod output_stream; -mod output_target; -mod piece_length_picker; -mod piece_list; -mod platform; -mod platform_interface; -mod print; -mod reckoner; -mod run; -mod sha1_digest; -mod shell; -mod sort_key; -mod sort_order; -mod sort_spec; -mod status; -mod step; -mod style; -mod subcommand; -mod table; -mod torrent_summary; -mod use_color; -mod verifier; -mod walker; -mod xor_args; +pub mod arguments; +pub mod bytes; +pub mod common; +pub mod consts; +pub mod env; +pub mod error; +pub mod file_error; +pub mod file_info; +pub mod file_path; +pub mod file_status; +pub mod files; +pub mod hasher; +pub mod host_port; +pub mod host_port_parse_error; +pub mod info; +pub mod infohash; +pub mod input; +pub mod input_stream; +pub mod input_target; +pub mod into_u64; +pub mod into_usize; +pub mod invariant; +pub mod lint; +pub mod linter; +pub mod magnet_link; +pub mod magnet_link_parse_error; +pub mod md5_digest; +pub mod metainfo; +pub mod metainfo_error; +pub mod mode; +pub mod options; +pub mod output_stream; +pub mod output_target; +pub mod piece_length_picker; +pub mod piece_list; +pub mod platform; +pub mod platform_interface; +pub mod print; +pub mod reckoner; +pub mod run; +pub mod sha1_digest; +pub mod shell; +pub mod sort_key; +pub mod sort_order; +pub mod sort_spec; +pub mod status; +pub mod step; +pub mod style; +pub mod subcommand; +pub mod table; +pub mod torrent_summary; +pub mod use_color; +pub mod verifier; +pub mod walker; +pub mod xor_args; #[cfg(feature = "bench")] pub mod bench; diff --git a/src/magnet_link.rs b/src/magnet_link.rs index e7acd1f..9eb4a04 100644 --- a/src/magnet_link.rs +++ b/src/magnet_link.rs @@ -1,17 +1,17 @@ use crate::common::*; #[derive(Debug, PartialEq)] -pub(crate) struct MagnetLink { - infohash: Infohash, - name: Option, - peers: Vec, - trackers: Vec, - indices: BTreeSet, +pub struct MagnetLink { + pub infohash: Infohash, + pub name: Option, + pub peers: Vec, + pub trackers: Vec, + pub indices: BTreeSet, } impl MagnetLink { /// See `Info::infohash_lossy` for details on when this function is lossy. - pub(crate) fn from_metainfo_lossy(metainfo: &Metainfo) -> Result { + pub fn from_metainfo_lossy(metainfo: &Metainfo) -> Result { let mut link = Self::with_infohash(metainfo.infohash_lossy()?); link.set_name(metainfo.info.name.clone()); @@ -23,7 +23,7 @@ impl MagnetLink { Ok(link) } - pub(crate) fn with_infohash(infohash: Infohash) -> Self { + pub fn with_infohash(infohash: Infohash) -> Self { MagnetLink { infohash, name: None, @@ -34,23 +34,23 @@ impl MagnetLink { } #[allow(dead_code)] - pub(crate) fn set_name(&mut self, name: impl Into) { + pub fn set_name(&mut self, name: impl Into) { self.name = Some(name.into()); } - pub(crate) fn add_peer(&mut self, peer: HostPort) { + pub fn add_peer(&mut self, peer: HostPort) { self.peers.push(peer); } - pub(crate) fn add_tracker(&mut self, tracker: Url) { + pub fn add_tracker(&mut self, tracker: Url) { self.trackers.push(tracker); } - pub(crate) fn add_index(&mut self, index: u64) { + pub fn add_index(&mut self, index: u64) { self.indices.insert(index); } - pub(crate) fn to_url(&self) -> Url { + pub fn to_url(&self) -> Url { let mut url = Url::parse("magnet:").invariant_unwrap("`magnet:` is valid URL"); let mut query = format!("xt=urn:btih:{}", self.infohash); @@ -85,7 +85,7 @@ impl MagnetLink { url } - fn parse(text: &str) -> Result { + pub fn parse(text: &str) -> Result { let url = Url::parse(&text).context(magnet_link_parse_error::Url)?; if url.scheme() != "magnet" { diff --git a/src/magnet_link_parse_error.rs b/src/magnet_link_parse_error.rs index 27d9a61..e4742fc 100644 --- a/src/magnet_link_parse_error.rs +++ b/src/magnet_link_parse_error.rs @@ -2,7 +2,7 @@ use crate::common::*; #[derive(Debug, Snafu)] #[snafu(visibility(pub(crate)))] -pub(crate) enum MagnetLinkParseError { +pub enum MagnetLinkParseError { #[snafu(display("Failed to parse hex string `{}`: {}", text, source))] HexParse { text: String, diff --git a/src/metainfo.rs b/src/metainfo.rs index a90b223..874b587 100644 --- a/src/metainfo.rs +++ b/src/metainfo.rs @@ -1,68 +1,68 @@ use crate::common::*; #[derive(Deserialize, Serialize, Debug, PartialEq, Clone)] -pub(crate) struct Metainfo { +pub struct Metainfo { #[serde( skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) announce: Option, + pub announce: Option, #[serde( rename = "announce-list", skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) announce_list: Option>>, + pub announce_list: Option>>, #[serde( skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) comment: Option, + pub comment: Option, #[serde( rename = "created by", skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) created_by: Option, + pub created_by: Option, #[serde( rename = "creation date", skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) creation_date: Option, + pub creation_date: Option, #[serde( skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) encoding: Option, - pub(crate) info: Info, + pub encoding: Option, + pub info: Info, #[serde( skip_serializing_if = "Option::is_none", default, with = "unwrap_or_skip" )] - pub(crate) nodes: Option>, + pub nodes: Option>, } impl Metainfo { - pub(crate) fn from_input(input: &Input) -> Result { + pub fn from_input(input: &Input) -> Result { Self::deserialize(input.source(), input.data()) } - pub(crate) fn deserialize(source: &InputTarget, data: &[u8]) -> Result { + pub fn deserialize(source: &InputTarget, data: &[u8]) -> Result { let metainfo = bendy::serde::de::from_bytes(&data).context(error::MetainfoDeserialize { input: source.clone(), })?; Ok(metainfo) } - pub(crate) fn serialize(&self) -> Result, Error> { + pub fn serialize(&self) -> Result, Error> { bendy::serde::ser::to_bytes(&self).context(error::MetainfoSerialize) } @@ -99,7 +99,7 @@ impl Metainfo { self.info.content_size() } - pub(crate) fn trackers<'a>(&'a self) -> impl Iterator> + 'a { + pub fn trackers<'a>(&'a self) -> impl Iterator> + 'a { let mut seen = HashSet::new(); iter::once(&self.announce) .flatten() diff --git a/src/metainfo_error.rs b/src/metainfo_error.rs index 0008e11..48c3e4b 100644 --- a/src/metainfo_error.rs +++ b/src/metainfo_error.rs @@ -1,7 +1,7 @@ use crate::common::*; #[derive(Debug, Copy, Clone)] -pub(crate) enum MetainfoError { +pub enum MetainfoError { Type, InfoMissing, InfoType, diff --git a/src/sha1_digest.rs b/src/sha1_digest.rs index 3622940..993d9a3 100644 --- a/src/sha1_digest.rs +++ b/src/sha1_digest.rs @@ -1,22 +1,22 @@ use crate::common::*; #[derive(Debug, Eq, PartialEq, Copy, Clone)] -pub(crate) struct Sha1Digest { - bytes: [u8; Self::LENGTH], +pub struct Sha1Digest { + pub bytes: [u8; Self::LENGTH], } impl Sha1Digest { - pub(crate) const LENGTH: usize = 20; + pub const LENGTH: usize = 20; - pub(crate) fn from_bytes(bytes: [u8; Self::LENGTH]) -> Self { + pub fn from_bytes(bytes: [u8; Self::LENGTH]) -> Self { Sha1Digest { bytes } } - pub(crate) fn bytes(self) -> [u8; Self::LENGTH] { + pub fn bytes(self) -> [u8; Self::LENGTH] { self.bytes } - pub(crate) fn from_data(data: impl AsRef<[u8]>) -> Self { + pub fn from_data(data: impl AsRef<[u8]>) -> Self { Sha1::from(data).digest().into() } } diff --git a/src/shell.rs b/src/shell.rs index 1c7bd87..38adefd 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -4,7 +4,7 @@ use structopt::clap; #[derive(Copy, Clone, EnumVariantNames, IntoStaticStr, EnumString, EnumIter, Debug)] #[strum(serialize_all = "kebab-case")] -pub(crate) enum Shell { +pub enum Shell { Zsh, Bash, Fish, diff --git a/src/torrent_summary.rs b/src/torrent_summary.rs index 90bcbf5..0307394 100644 --- a/src/torrent_summary.rs +++ b/src/torrent_summary.rs @@ -1,30 +1,30 @@ use crate::common::*; -pub(crate) struct TorrentSummary { +pub struct TorrentSummary { infohash: Infohash, metainfo: Metainfo, size: Bytes, } #[derive(Serialize)] -pub(crate) struct TorrentSummaryJson { - name: String, - comment: Option, - creation_date: Option, - created_by: Option, - source: Option, - info_hash: String, - torrent_size: u64, - content_size: u64, - private: bool, - tracker: Option, - announce_list: Vec>, - update_url: Option, - dht_nodes: Vec, - piece_size: u64, - piece_count: usize, - file_count: usize, - files: Vec, +pub struct TorrentSummaryJson { + pub name: String, + pub comment: Option, + pub creation_date: Option, + pub created_by: Option, + pub source: Option, + pub info_hash: String, + pub torrent_size: u64, + pub content_size: u64, + pub private: bool, + pub tracker: Option, + pub announce_list: Vec>, + pub update_url: Option, + pub dht_nodes: Vec, + pub piece_size: u64, + pub piece_count: usize, + pub file_count: usize, + pub files: Vec, } impl TorrentSummary { @@ -37,14 +37,14 @@ impl TorrentSummary { } /// See `Info::infohash_lossy` for details on when this function is lossy. - pub(crate) fn from_metainfo_lossy(metainfo: Metainfo) -> Result { + pub fn from_metainfo_lossy(metainfo: Metainfo) -> Result { let bytes = metainfo.serialize()?; let size = Bytes(bytes.len().into_u64()); let infohash = metainfo.infohash_lossy()?; Ok(Self::new(metainfo, infohash, size)) } - pub(crate) fn from_input(input: &Input) -> Result { + pub fn from_input(input: &Input) -> Result { let metainfo = Metainfo::from_input(input)?; let infohash = Infohash::from_input(input)?; let size = Bytes(input.data().len().into_u64()); @@ -52,7 +52,7 @@ impl TorrentSummary { Ok(Self::new(metainfo, infohash, size)) } - pub(crate) fn write(&self, env: &mut Env) -> Result<()> { + pub fn write(&self, env: &mut Env) -> Result<()> { let table = self.table(); if env.out().is_term() { @@ -168,14 +168,14 @@ impl TorrentSummary { table } - pub(crate) fn write_json(&self, env: &mut Env) -> Result<()> { + pub fn write_json(&self, env: &mut Env) -> Result<()> { let data = self.torrent_summary_data(); let json = serde_json::to_string(&data).context(error::JsonSerialize)?; outln!(env, "{}", json)?; Ok(()) } - fn torrent_summary_data(&self) -> TorrentSummaryJson { + pub fn torrent_summary_data(&self) -> TorrentSummaryJson { let (file_count, files) = match &self.metainfo.info.mode { Mode::Single { .. } => (1, vec![self.metainfo.info.name.clone()]), Mode::Multiple { files } => (