diff --git a/Cargo.lock b/Cargo.lock index 3468da7..17fcffb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,1452 +1,1773 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] -name = "antidote" -version = "1.0.0" +name = "ab_glyph_rasterizer" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2692800d602527d2b8fea50036119c37df74ab565b10e285706a3dcec0ec3e16" [[package]] -name = "approx" -version = "0.1.1" +name = "anyhow" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" [[package]] -name = "arrayvec" -version = "0.4.7" +name = "autocfg" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "badge" version = "0.2.0" dependencies = [ - "base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rusttype 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.12.3", + "once_cell", + "rusttype", ] [[package]] name = "base64" -version = "0.6.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "safemem", ] [[package]] name = "base64" -version = "0.9.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "bitflags" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" [[package]] name = "bitflags" -version = "1.0.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.2.1" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" -version = "0.4.6" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "iovec", ] [[package]] name = "cadence" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99612ce0a00efdaf3d81a5e8e17f0eed55a10e862033183c847a0365983af88c" dependencies = [ - "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam", +] + +[[package]] +name = "cargo-lock" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8504b63dd1249fd1745b7b4ef9b6f7b107ddeb3c95370043c7dbcc38653a2679" +dependencies = [ + "semver 0.9.0", + "serde", + "toml", + "url", ] [[package]] name = "cc" -version = "1.0.9" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" -version = "0.1.2" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "chrono" -version = "0.4.0" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d021fddb7bd3e734370acfa4a83f34095571d8570c039f1420d77540f68d5772" dependencies = [ - "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "num-integer", + "num-traits", + "serde", + "time", + "winapi 0.3.9", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.2.1", ] [[package]] name = "core-foundation" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" dependencies = [ - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys", + "libc", ] [[package]] name = "core-foundation-sys" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", +] + +[[package]] +name = "crates-index" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15467291e8911aa3e73b0e77d988362da1df7ac974c7189ab38b94b6f7edfa7e" +dependencies = [ + "git2", + "glob", + "hex", + "home", + "serde", + "serde_derive", + "serde_json", + "smol_str", ] [[package]] name = "crossbeam" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" [[package]] name = "crossbeam-deque" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" dependencies = [ - "crossbeam-epoch 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", ] [[package]] name = "crossbeam-epoch" -version = "0.4.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "cfg-if", + "crossbeam-utils", + "lazy_static 1.4.0", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "maybe-uninit", ] [[package]] name = "crossbeam-utils" -version = "0.2.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "cfg-if", + "lazy_static 1.4.0", ] [[package]] -name = "crossbeam-utils" -version = "0.3.2" +name = "cvss" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c425c059aef1e9cc614482211c4bd78664299ca91d4353db994f9966a1e7161d" dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] -name = "dtoa" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "failure" -version = "0.1.1" +name = "derive_more" +version = "0.99.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dcfabdab475c16a93d669dddfc393027803e347d09663f524447f642fbb84ba" dependencies = [ - "backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "failure_derive" -version = "0.1.1" +name = "digest" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types-shared", ] [[package]] name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" dependencies = [ - "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1", + "fuchsia-zircon-sys", ] [[package]] name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.19" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" [[package]] name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "num_cpus", ] [[package]] -name = "gcc" -version = "0.3.54" +name = "generic-array" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "git2" +version = "0.13.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e094214efbc7fdbbdee952147e493b00e99a4e52817492277e98967ae918165" +dependencies = [ + "bitflags 1.2.1", + "libc", + "libgit2-sys", + "log 0.4.11", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" + +[[package]] +name = "hermit-abi" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +dependencies = [ + "serde", +] + +[[package]] +name = "home" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" +dependencies = [ + "winapi 0.3.9", +] [[package]] name = "httparse" -version = "1.2.4" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" [[package]] name = "hyper" -version = "0.10.13" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" dependencies = [ - "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hyper" -version = "0.11.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hyper-native-tls" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3", + "bytes", + "futures", + "futures-cpupool", + "httparse", + "iovec", + "language-tags", + "log 0.4.11", + "mime", + "net2", + "percent-encoding 1.0.1", + "relay", + "time", + "tokio-core", + "tokio-io", + "tokio-proto", + "tokio-service", + "unicase", + "want", ] [[package]] name = "hyper-tls" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1bd5e518d3065840ab315dbbf44e4420e5f7d80e2cb93fa6ffffc50522378" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "hyper", + "native-tls", + "tokio-core", + "tokio-io", + "tokio-service", + "tokio-tls", ] [[package]] name = "idna" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.0.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "hashbrown", + "serde", ] [[package]] name = "iovec" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "itoa" -version = "0.3.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] -name = "itoa" -version = "0.4.1" +name = "jobserver" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +dependencies = [ + "libc", +] [[package]] name = "kernel32-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] [[package]] name = "language-tags" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" [[package]] name = "lazy_static" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" [[package]] name = "lazy_static" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazycell" -version = "0.6.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.40" +version = "0.2.77" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" + +[[package]] +name = "libgit2-sys" +version = "0.12.13+1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069eea34f76ec15f2822ccf78fe0cdb8c9016764d0a12865278585a74dbdeae5" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] name = "linked-hash-map" -version = "0.4.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" [[package]] -name = "literalext" -version = "0.1.1" +name = "lock_api" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] [[package]] name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11", ] [[package]] name = "log" -version = "0.4.1" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "lru-cache" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" dependencies = [ - "linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map", ] [[package]] -name = "matches" -version = "0.1.6" +name = "maplit" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "maud" -version = "0.17.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84613702fc079d2e22a2d39b9a1b80a8da9e82b13fb5fe7abcd488928ea75fdb" dependencies = [ - "maud_htmlescape 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "maud_macros 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maud_htmlescape", + "maud_macros", ] [[package]] name = "maud_htmlescape" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0fb85bccffc42302ad1e1ed8679f6a39d1317f775a37fbc3f79bdfbe054bfb7" [[package]] name = "maud_macros" -version = "0.17.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb626dcc05fdacb1796b5efae3ea50ca1213713925093e2febb7d33ba5c9bcd" dependencies = [ - "literalext 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "maud_htmlescape 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", + "maud_htmlescape", + "syn", ] +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "memoffset" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "mime" -version = "0.2.6" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", ] [[package]] name = "mime" -version = "0.3.5" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mio" -version = "0.6.14" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log 0.4.11", + "miow", + "net2", + "slab 0.4.2", + "winapi 0.2.8", +] + +[[package]] +name = "mio-uds" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +dependencies = [ + "iovec", + "libc", + "mio", ] [[package]] name = "miow" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", ] [[package]] name = "native-tls" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" dependencies = [ - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11", + "libc", + "openssl", + "schannel", + "security-framework", + "security-framework-sys", + "tempdir", ] [[package]] name = "net2" -version = "0.2.32" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "nodrop" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "winapi 0.3.9", ] [[package]] name = "num-integer" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-iter" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ - "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "num-traits", ] [[package]] name = "num-traits" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +dependencies = [ + "autocfg", +] [[package]] name = "num_cpus" -version = "1.8.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi", + "libc", ] +[[package]] +name = "once_cell" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "openssl" version = "0.9.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.27 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.9.1", + "foreign-types", + "lazy_static 1.4.0", + "libc", + "openssl-sys", ] +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" + [[package]] name = "openssl-sys" -version = "0.9.27" +version = "0.9.58" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ - "cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] -name = "ordered-float" -version = "0.5.0" +name = "owned_ttf_parser" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ - "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ttf-parser", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api", + "parking_lot_core", + "rustc_version", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +dependencies = [ + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "rustc_version", + "smallvec 0.6.13", + "winapi 0.3.9", ] [[package]] name = "percent-encoding" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +dependencies = [ + "maplit", + "pest", + "sha-1", +] [[package]] name = "pkg-config" -version = "0.3.9" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" + +[[package]] +name = "platforms" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" +dependencies = [ + "serde", +] [[package]] name = "proc-macro2" -version = "0.2.3" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ef7cd2518ead700af67bf9d1a658d90b6037d77110fd9c0445429d0ba1c6c9" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid", ] [[package]] name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "quote" -version = "0.4.2" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] name = "rand" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "rand 0.4.6", ] [[package]] name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1", ] [[package]] name = "redox_syscall" -version = "0.1.37" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "relative-path" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e614f96449605730b4f7ad2c019e88c1652d730634b4eba07b810801856635e3" dependencies = [ - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] name = "relay" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", ] [[package]] name = "remove_dir_all" -version = "0.5.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "reqwest" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9", ] [[package]] name = "route-recognizer" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea509065eb0b3c446acdd0102f0d46567dc30902dc0be91d6552035d92b0f4f8" [[package]] -name = "rustc-demangle" -version = "0.1.7" +name = "rustc_version" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] [[package]] name = "rustsec" -version = "0.6.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2f7c2b431b329341b1ee7193b7403269153b99804ff5850a0b8966aed26f558" dependencies = [ - "reqwest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo-lock", + "chrono", + "crates-index", + "cvss", + "git2", + "home", + "platforms", + "semver 0.9.0", + "semver-parser 0.9.0", + "serde", + "thiserror", + "toml", ] [[package]] name = "rusttype" -version = "0.5.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" dependencies = [ - "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "stb_truetype 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] -name = "safemem" -version = "0.2.0" +name = "ryu" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" [[package]] name = "sass-rs" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cabcf7c6e55053f359911187ac401409aad2dc14338cae972dec266fee486abd" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "sass-sys 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "sass-sys", ] [[package]] name = "sass-sys" -version = "0.4.4" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df9ac0fd0b8d62a99b9948094dcd56c441e3e10bf49f9b12da40b2183804908" dependencies = [ - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", + "num_cpus", + "pkg-config", ] [[package]] name = "schannel" -version = "0.1.11" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0", + "winapi 0.3.9", ] [[package]] name = "scoped-tls" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" [[package]] name = "scopeguard" -version = "0.3.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" dependencies = [ - "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" dependencies = [ - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys", + "libc", ] [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", + "semver-parser 0.7.0", + "serde", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.0", + "serde", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "semver-parser" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46e1121e8180c12ff69a742aabc4f310542b6ccb69f1691689ac17fdf8618aa" + +[[package]] +name = "semver-parser" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e012c6c5380fb91897ba7b9261a0f565e624e869d42fe1a1d03fa0d68a083d5" +dependencies = [ + "pest", + "pest_derive", +] [[package]] name = "serde" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde" -version = "1.0.35" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_derive" -version = "1.0.35" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_derive_internals" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "serde_json" -version = "0.9.10" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" dependencies = [ - "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa", + "ryu", + "serde", ] [[package]] -name = "serde_json" -version = "1.0.13" +name = "sha-1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_urlencoded" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "shared_failure" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", ] [[package]] name = "shiny-robots" version = "0.1.0" dependencies = [ - "badge 0.2.0", - "cadence 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "maud 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", - "relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "route-recognizer 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "rustsec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sass-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "shared_failure 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "try_future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow", + "badge", + "cadence", + "derive_more", + "futures", + "hyper", + "hyper-tls", + "indexmap", + "lru-cache", + "maud", + "once_cell", + "relative-path", + "route-recognizer", + "rustsec", + "sass-rs", + "semver 0.11.0", + "serde", + "serde_json", + "slog", + "slog-json", + "tokio-core", + "tokio-service", + "toml", + "try_future", ] [[package]] name = "slab" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" [[package]] name = "slab" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "slog" -version = "2.2.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc9c640a4adbfbcc11ffb95efe5aa7af7309e002adab54b185507dbf2377b99" [[package]] name = "slog-json" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc0d2aff1f8f325ef660d9a0eb6e6dcd20b30b3f581a5897f58bf42d061c37a" dependencies = [ - "chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono", + "serde", + "serde_json", + "slog", ] [[package]] name = "smallvec" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" [[package]] -name = "stb_truetype" -version = "0.2.2" +name = "smallvec" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit", +] + +[[package]] +name = "smol_str" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca0f7ce3a29234210f0f4f0b56f8be2e722488b95cb522077943212da3b32eb" +dependencies = [ + "serde", ] [[package]] name = "syn" -version = "0.11.11" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c51d92969d209b54a98397e1b91c8ae82d8c87a7bb87df0b29aa2ad81454228" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "synstructure" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] name = "take" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" [[package]] name = "tempdir" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" dependencies = [ - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6", + "remove_dir_all", +] + +[[package]] +name = "thiserror" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] name = "time" -version = "0.1.39" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "wasi", + "winapi 0.3.9", ] [[package]] -name = "tokio" -version = "0.1.4" +name = "tinyvec" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" + +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "mio", + "num_cpus", + "tokio-codec", + "tokio-current-thread", + "tokio-executor", + "tokio-fs", + "tokio-io", + "tokio-reactor", + "tokio-sync", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "tokio-udp", + "tokio-uds", +] + +[[package]] +name = "tokio-codec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" +dependencies = [ + "bytes", + "futures", + "tokio-io", ] [[package]] name = "tokio-core" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" dependencies = [ - "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "iovec", + "log 0.4.11", + "mio", + "scoped-tls", + "tokio", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-timer", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +dependencies = [ + "futures", + "tokio-executor", ] [[package]] name = "tokio-executor" -version = "0.1.1" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils", + "futures", +] + +[[package]] +name = "tokio-fs" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" +dependencies = [ + "futures", + "tokio-io", + "tokio-threadpool", ] [[package]] name = "tokio-io" -version = "0.1.6" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ - "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "log 0.4.11", ] [[package]] name = "tokio-proto" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "log 0.3.9", + "net2", + "rand 0.3.23", + "slab 0.3.0", + "smallvec 0.2.1", + "take", + "tokio-core", + "tokio-io", + "tokio-service", ] [[package]] name = "tokio-reactor" -version = "0.1.1" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils", + "futures", + "lazy_static 1.4.0", + "log 0.4.11", + "mio", + "num_cpus", + "parking_lot", + "slab 0.4.2", + "tokio-executor", + "tokio-io", + "tokio-sync", ] [[package]] name = "tokio-service" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", +] + +[[package]] +name = "tokio-sync" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +dependencies = [ + "fnv", + "futures", ] [[package]] name = "tokio-tcp" -version = "0.1.0" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ - "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "iovec", + "mio", + "tokio-io", + "tokio-reactor", ] [[package]] name = "tokio-threadpool" -version = "0.1.1" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" dependencies = [ - "crossbeam-deque 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "futures", + "lazy_static 1.4.0", + "log 0.4.11", + "num_cpus", + "slab 0.4.2", + "tokio-executor", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +dependencies = [ + "crossbeam-utils", + "futures", + "slab 0.4.2", + "tokio-executor", ] [[package]] name = "tokio-tls" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "native-tls", + "tokio-core", + "tokio-io", ] [[package]] name = "tokio-udp" -version = "0.1.0" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ - "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "log 0.4.11", + "mio", + "tokio-codec", + "tokio-io", + "tokio-reactor", +] + +[[package]] +name = "tokio-uds" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" +dependencies = [ + "bytes", + "futures", + "iovec", + "libc", + "log 0.4.11", + "mio", + "mio-uds", + "tokio-codec", + "tokio-io", + "tokio-reactor", ] [[package]] name = "toml" -version = "0.3.2" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" dependencies = [ - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] -name = "toml" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "traitobject" +name = "try-lock" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" [[package]] name = "try_future" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30454186ee38f29e06f386c6e9f773b7c33e85430db6f90e4597419b4c5baad7" dependencies = [ - "futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", ] [[package]] -name = "typeable" -version = "0.1.2" +name = "ttf-parser" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "unicase" -version = "1.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ - "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicase" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check", ] [[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unreachable" -version = "0.1.1" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tinyvec", ] [[package]] -name = "url" -version = "1.7.0" +name = "unicode-xid" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "idna", + "matches", + "percent-encoding 2.1.0", ] [[package]] name = "vcpkg" -version = "0.2.2" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" [[package]] name = "version_check" -version = "0.1.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] -name = "void" -version = "1.0.2" +name = "want" +version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" +dependencies = [ + "futures", + "log 0.4.11", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "ws2_32-sys" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] - -[metadata] -"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" -"checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" -"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" -"checksum backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbbf59b1c43eefa8c3ede390fcc36820b4999f7914104015be25025e0d62af2" -"checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661" -"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" -"checksum base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "229d032f1a99302697f10b27167ae6d03d49d032e6a8e2550e8d3fc13356d2b4" -"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" -"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" -"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" -"checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9" -"checksum cadence 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "99612ce0a00efdaf3d81a5e8e17f0eed55a10e862033183c847a0365983af88c" -"checksum cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2b4911e4bdcb4100c7680e7e854ff38e23f1b34d4d9e079efae3da2801341ffc" -"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" -"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" -"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" -"checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" -"checksum crossbeam-deque 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c1bdc73742c36f7f35ebcda81dbb33a7e0d33757d03a06d9ddca762712ec5ea2" -"checksum crossbeam-epoch 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b4e2817eb773f770dcb294127c011e22771899c21d18fce7dd739c0b9832e81" -"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" -"checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b" -"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" -"checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82" -"checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f32b9e9aaa890fe8b9453b27ebbf3d11136a5ce59032500effd0e707bbcd80" -"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" -"checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37" -"checksum hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)" = "368cb56b2740ebf4230520e2b90ebb0461e69034d85d1945febd9b3971426db2" -"checksum hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)" = "df4dd5dae401458087396b6db7fabc4d6760aa456a5fa8e92bda549f39cae661" -"checksum hyper-native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72332e4a35d3059583623b50e98e491b78f8b96c5521fcb3f428167955aa56e8" -"checksum hyper-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a5aa51f6ae9842239b0fac14af5f22123b8432b4cc774a44ff059fcba0f675ca" -"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" -"checksum indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08173ba1e906efb6538785a8844dd496f5d34f0a2d88038e95195172fc667220" -"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" -"checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" -"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" -"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" -"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b" -"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939" -"checksum literalext 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2f42dd699527975a1e0d722e0707998671188a0125f2051d2d192fc201184a81" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" -"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" -"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" -"checksum maud 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c0023c814f4a545946ab612ad64a4edce8126d4fe4f0abc5f319b80877112048" -"checksum maud_htmlescape 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0fb85bccffc42302ad1e1ed8679f6a39d1317f775a37fbc3f79bdfbe054bfb7" -"checksum maud_macros 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8377d77c1995044b8ad67a59d15b434c8b7de470ac743de4916ee2bd9fce55" -"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e00e17be181010a91dbfefb01660b17311059dc8c7f48b9017677721e732bd" -"checksum mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "6d771e3ef92d58a8da8df7d6976bfca9371ed1de6619d9d5a5ce5b1f29b85bfe" -"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" -"checksum net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9044faf1413a1057267be51b5afba8eb1090bd2231c693664aa1db716fe1eae0" -"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" -"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -"checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe" -"checksum num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "4b226df12c5a59b63569dd57fafb926d91b385dfce33d8074a412411b689d593" -"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dee092fcdf725aee04dd7da1d21debff559237d49ef1cb3e69bcb8ece44c7364" -"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" -"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" -"checksum openssl-sys 0.9.27 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdc5c4a02e69ce65046f1763a0181107038e02176233acb0b3351d7cc588f9" -"checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" -"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" -"checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" -"checksum relative-path 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e614f96449605730b4f7ad2c019e88c1652d730634b4eba07b810801856635e3" -"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" -"checksum remove_dir_all 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfc5b3ce5d5ea144bb04ebd093a9e14e9765bcfec866aecda9b6dec43b3d1e24" -"checksum reqwest 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bef9ed8fdfcc30947d6b774938dc0c3f369a474efe440df2c7f278180b2d2e6" -"checksum route-recognizer 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3255338088df8146ba63d60a9b8e3556f1146ce2973bc05a75181a42ce2256" -"checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb" -"checksum rustsec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9fb074a338f1f966f5d86eaef9aa85b544207ed138986e60a33e08202c5c4492" -"checksum rusttype 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4667e40922320e08b358ce9cfc7d08cc37a827f223c0e113b5dee573143a534d" -"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum sass-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90f8cf6e645aa843ffffcbdc1e8752b1f221dfa314c81895aeb229a77aea7e05" -"checksum sass-sys 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a71105d35ea2c3622fceb9128897115932c698561940a453452744413faf3561" -"checksum schannel 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "fbaffce35eb61c5b00846e73128b0cd62717e7c0ec46abbec132370d013975b4" -"checksum scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8674d439c964889e2476f474a3bf198cc9e199e77499960893bac5de7e9218a4" -"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" -"checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" -"checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" -"checksum serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "800fdb0a894572994f3970035a8a5f65d8ec2cd40e6cdf7d8cd9001d7b30648e" -"checksum serde_derive 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "90f1f8f7784452461db5b73dc5097c18f21011fbcc6d1178f1897bfa8e1cb4bd" -"checksum serde_derive_internals 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f9525ada08124ee1a9b8b1e6f3bf035ffff6fc0c96d56ddda98d4506d3533e4" -"checksum serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ad8bcf487be7d2e15d3d543f04312de991d631cfe1b43ea0ade69e6a8a5b16a1" -"checksum serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "5c508584d9913df116b91505eec55610a2f5b16e9ed793c46e4d0152872b3e74" -"checksum serde_urlencoded 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "68f06ece1408d3221d11a9da11953ad0c94daa48cfa42026471306f895b91bc8" -"checksum shared_failure 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95950ce835eb54ad4d85f5f597a3d7f78cb0f6622f65dabc2dac915d9edc404a" -"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" -"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d" -"checksum slog 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe14c4e48db18a120c5edcdef669604364d07642496b0d4df2efa16be908e1e" -"checksum slog-json 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddd14b8df2df39378b3e933c79784350bf715b11444d99f903df0253bbe524e5" -"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" -"checksum stb_truetype 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "52ce2b38abdd11cffbc68928810248e0dd003fea489a88a404dc1ba7ae2d5538" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)" = "8c5bc2d6ff27891209efa5f63e9de78648d7801f085e4653701a692ce938d6fd" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -"checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" -"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" -"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098" -"checksum tokio 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "65bd27f59c223e7c9e406bcdadb453e143bcf1242e162ae6c0f0eb6d14487306" -"checksum tokio-core 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "799492ccba3d8ed5e41f2520a7cfd504cb65bbfe5fbbbd0012e335ae5f188051" -"checksum tokio-executor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3aca092a94dc6e736819347a990a86ed734a6543a9d6f817929fa4dc8c4334e2" -"checksum tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6af9eb326f64b2d6b68438e1953341e00ab3cf54de7e35d92bfc73af8555313a" -"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" -"checksum tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3cedc8e5af5131dc3423ffa4f877cce78ad25259a9a62de0613735a13ebc64b" -"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" -"checksum tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec9b094851aadd2caf83ba3ad8e8c4ce65a42104f7b94d9e6550023f0407853f" -"checksum tokio-threadpool 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2057ff8a75d33639f9ea1b4b85cb113c7bbf4e06d132f148521d12cb6daa1a22" -"checksum tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" -"checksum tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "137bda266504893ac4774e0ec4c2108f7ccdbcb7ac8dced6305fe9e4e0b5041a" -"checksum toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd86ad9ebee246fdedd610e0f6d0587b754a3d81438db930a244d0480ed7878f" -"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum try_future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5991a93204dab99f8f1f8ac657eb070315dbd71a79f15fa4f86d983fa880545" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284b6d3db520d67fbe88fd778c21510d1b0ba4a551e5d0fbb023d33405f6de8a" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" -"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" -"checksum vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9e0a7d8bed3178a8fb112199d466eeca9ed09a14ba8ad67718179b4fd5487d0b" -"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/Cargo.toml b/Cargo.toml index b304980..1a9124e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,35 +2,40 @@ name = "shiny-robots" version = "0.1.0" authors = ["Sam Rijs "] +edition = "2018" + +[workspace] +members = [ + ".", + "./libs/badge", +] [dependencies] -cadence = "0.13.1" -failure = "0.1.1" -futures = "0.1.18" -hyper = "0.11.15" -hyper-tls = "0.1.2" -indexmap = { version = "1.0.0", features = ["serde-1"] } -lazy_static = "1.0.0" -lru-cache = "0.1.1" -maud = "0.17.2" -relative-path = { version = "0.3.7", features = ["serde"] } -route-recognizer = "0.1.12" -rustsec = "0.6.0" -semver = { version = "0.9.0", features = ["serde"] } -serde = "1.0.27" -serde_derive = "1.0.27" -serde_json = "1.0.9" -shared_failure = "0.1.0" -slog = "2.1.1" -slog-json = "2.2.0" -tokio-core = "0.1.12" -tokio-service = "0.1.0" -toml = "0.4.5" -try_future = "0.1.1" +badge = { path = "./libs/badge" } + +anyhow = "1" +cadence = "0.13" +derive_more = "0.99" +futures = "0.1" +hyper = "0.11" +hyper-tls = "0.1" +indexmap = { version = "1", features = ["serde-1"] } +lru-cache = "0.1" +maud = "0.22" +once_cell = "1.4" +relative-path = { version = "0.3.7", features = ["serde"] } +route-recognizer = "0.1" +rustsec = "0.21" +semver = { version = "0.11", features = ["serde"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +slog = "2" +slog-json = "2" +tokio-core = "0.1" +tokio-service = "0.1" +toml = "0.5" +try_future = "0.1" -[dependencies.badge] -version = "0.2.0" -path = "libs/badge" [build-dependencies] -sass-rs = "0.2.1" +sass-rs = "0.2" diff --git a/build.rs b/build.rs index 24305cb..3fb6176 100644 --- a/build.rs +++ b/build.rs @@ -11,8 +11,7 @@ fn build_style() -> String { ..Default::default() }; - sass::compile_file("./assets/styles/main.sass", options) - .expect("failed to compile style sheet") + sass::compile_file("./assets/styles/main.sass", options).expect("failed to compile style sheet") } fn main() { diff --git a/libs/badge/.gitignore b/libs/badge/.gitignore new file mode 100644 index 0000000..4fac09a --- /dev/null +++ b/libs/badge/.gitignore @@ -0,0 +1 @@ +/test.svg diff --git a/libs/badge/Cargo.toml b/libs/badge/Cargo.toml index a4dd101..45dc400 100644 --- a/libs/badge/Cargo.toml +++ b/libs/badge/Cargo.toml @@ -6,11 +6,12 @@ authors = ["Onur Aslan "] license-file = "LICENSE" repository = "https://github.com/onur/docs.rs" documentation = "https://docs.rs/badge" +edition = "2018" [lib] path = "badge.rs" [dependencies] -base64 = "0.9.0" -lazy_static = "1.0.0" -rusttype = "0.5.0" +base64 = "0.12" +once_cell = "1" +rusttype = "0.9" diff --git a/libs/badge/badge.rs b/libs/badge/badge.rs index 9e1eb02..c28310c 100644 --- a/libs/badge/badge.rs +++ b/libs/badge/badge.rs @@ -1,18 +1,16 @@ //! Simple badge generator -extern crate base64; -#[macro_use] extern crate lazy_static; -extern crate rusttype; - - use base64::display::Base64Display; -use rusttype::{Font, FontCollection, Scale, point, Point, PositionedGlyph}; +use once_cell::sync::Lazy; +use rusttype::{point, Font, Point, PositionedGlyph, Scale}; - -const FONT_DATA: &'static [u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), - "/DejaVuSans.ttf")); +const FONT_DATA: &'static [u8] = + include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/DejaVuSans.ttf")); const FONT_SIZE: f32 = 11.; - +const SCALE: Scale = Scale { + x: FONT_SIZE, + y: FONT_SIZE, +}; pub struct BadgeOptions { /// Subject will be displayed on the left side of badge @@ -23,7 +21,6 @@ pub struct BadgeOptions { pub color: String, } - impl Default for BadgeOptions { fn default() -> BadgeOptions { BadgeOptions { @@ -34,54 +31,47 @@ impl Default for BadgeOptions { } } - struct BadgeStaticData { font: Font<'static>, scale: Scale, - offset: Point + offset: Point, } +static DATA: Lazy = Lazy::new(|| { + let font = Font::try_from_bytes(FONT_DATA).expect("failed to parse font collection"); -lazy_static! { - static ref DATA: BadgeStaticData = { - let collection = FontCollection::from_bytes(FONT_DATA) - .expect("failed to parse font collection"); - let font = collection.into_font() - .expect("failed to load font data"); - let scale = Scale { - x: FONT_SIZE, - y: FONT_SIZE, - }; - let v_metrics = font.v_metrics(scale); - let offset = point(0.0, v_metrics.ascent); - - BadgeStaticData { font, scale, offset } - }; -} + let v_metrics = font.v_metrics(SCALE); + let offset = point(0.0, v_metrics.ascent); + BadgeStaticData { + font, + scale: SCALE.clone(), + offset, + } +}); pub struct Badge { - options: BadgeOptions + options: BadgeOptions, } - impl Badge { pub fn new(options: BadgeOptions) -> Badge { Badge { options } } - pub fn to_svg_data_uri(&self) -> String { - format!("data:image/svg+xml;base64,{}", - Base64Display::standard(self.to_svg().as_bytes())) + format!( + "data:image/svg+xml;base64,{}", + Base64Display::with_config(self.to_svg().as_bytes(), base64::STANDARD) + ) } - pub fn to_svg(&self) -> String { let left_width = self.calculate_width(&self.options.subject) + 6; let right_width = self.calculate_width(&self.options.status) + 6; - let svg = format!(r###" + let svg = format!( + r###" @@ -118,16 +108,17 @@ impl Badge { left_width + (right_width / 2), self.options.status, left_width + (right_width / 2), - self.options.status); + self.options.status + ); svg } - fn calculate_width(&self, text: &str) -> u32 { let glyphs: Vec = DATA.font.layout(text, DATA.scale, DATA.offset).collect(); - let width = glyphs.iter() + let width = glyphs + .iter() .rev() .filter_map(|g| { g.pixel_bounding_box() @@ -139,8 +130,6 @@ impl Badge { } } - - #[cfg(test)] mod tests { use super::*; diff --git a/src/engine/fut/analyze.rs b/src/engine/fut/analyze.rs new file mode 100644 index 0000000..f2d3a81 --- /dev/null +++ b/src/engine/fut/analyze.rs @@ -0,0 +1,66 @@ +use anyhow::{anyhow, ensure, Error}; +use futures::stream::futures_unordered; +use futures::{Future, Poll, Stream}; + +use crate::models::crates::{AnalyzedDependencies, CrateDeps}; + +use super::super::machines::analyzer::DependencyAnalyzer; +use super::super::Engine; + +pub struct AnalyzeDependenciesFuture { + inner: Box>, +} + +impl AnalyzeDependenciesFuture { + pub fn new(engine: Engine, deps: CrateDeps) -> Self { + let future = + engine.fetch_advisory_db().and_then(move |advisory_db| { + let analyzer = DependencyAnalyzer::new(&deps, Some(advisory_db)); + + let main_deps = deps.main.into_iter().filter_map(|(name, dep)| { + if dep.is_external() { + Some(name) + } else { + None + } + }); + let dev_deps = deps.dev.into_iter().filter_map(|(name, dep)| { + if dep.is_external() { + Some(name) + } else { + None + } + }); + let build_deps = deps.build.into_iter().filter_map(|(name, dep)| { + if dep.is_external() { + Some(name) + } else { + None + } + }); + + let release_futures = + engine.fetch_releases(main_deps.chain(dev_deps).chain(build_deps)); + + futures_unordered(release_futures) + .fold(analyzer, |mut analyzer, releases| { + analyzer.process(releases); + Ok(analyzer) as Result<_, Error> + }) + .map(|analyzer| analyzer.finalize()) + }); + + AnalyzeDependenciesFuture { + inner: Box::new(future), + } + } +} + +impl Future for AnalyzeDependenciesFuture { + type Item = AnalyzedDependencies; + type Error = Error; + + fn poll(&mut self) -> Poll { + self.inner.poll() + } +} diff --git a/src/engine/futures/crawl.rs b/src/engine/fut/crawl.rs similarity index 61% rename from src/engine/futures/crawl.rs rename to src/engine/fut/crawl.rs index beb199e..827a39e 100644 --- a/src/engine/futures/crawl.rs +++ b/src/engine/fut/crawl.rs @@ -1,34 +1,40 @@ use std::mem; -use failure::Error; -use futures::{Async, Future, Poll, Stream}; +use anyhow::{anyhow, ensure, Error}; use futures::stream::FuturesOrdered; +use futures::{try_ready, Async, Future, Poll, Stream}; use relative_path::RelativePathBuf; -use ::models::repo::RepoPath; +use crate::models::repo::RepoPath; -use super::super::Engine; use super::super::machines::crawler::ManifestCrawler; pub use super::super::machines::crawler::ManifestCrawlerOutput; +use super::super::Engine; pub struct CrawlManifestFuture { repo_path: RepoPath, engine: Engine, crawler: ManifestCrawler, - futures: FuturesOrdered>> + futures: FuturesOrdered>>, } impl CrawlManifestFuture { pub fn new(engine: &Engine, repo_path: RepoPath, entry_point: RelativePathBuf) -> Self { - let future: Box> = Box::new(engine.retrieve_manifest_at_path(&repo_path, &entry_point) - .map(move |contents| (entry_point, contents))); + let future: Box> = Box::new( + engine + .retrieve_manifest_at_path(&repo_path, &entry_point) + .map(move |contents| (entry_point, contents)), + ); let engine = engine.clone(); let crawler = ManifestCrawler::new(); let mut futures = FuturesOrdered::new(); futures.push(future); CrawlManifestFuture { - repo_path, engine, crawler, futures + repo_path, + engine, + crawler, + futures, } } } @@ -42,12 +48,15 @@ impl Future for CrawlManifestFuture { None => { let crawler = mem::replace(&mut self.crawler, ManifestCrawler::new()); Ok(Async::Ready(crawler.finalize())) - }, + } Some((path, raw_manifest)) => { let output = self.crawler.step(path, raw_manifest)?; for path in output.paths_of_interest.into_iter() { - let future: Box> = Box::new(self.engine.retrieve_manifest_at_path(&self.repo_path, &path) - .map(move |contents| (path, contents))); + let future: Box> = Box::new( + self.engine + .retrieve_manifest_at_path(&self.repo_path, &path) + .map(move |contents| (path, contents)), + ); self.futures.push(future); } self.poll() diff --git a/src/engine/futures/mod.rs b/src/engine/fut/mod.rs similarity index 100% rename from src/engine/futures/mod.rs rename to src/engine/fut/mod.rs index 651f8c3..f902460 100644 --- a/src/engine/futures/mod.rs +++ b/src/engine/fut/mod.rs @@ -1,5 +1,5 @@ -mod crawl; mod analyze; +mod crawl; -pub use self::crawl::CrawlManifestFuture; pub use self::analyze::AnalyzeDependenciesFuture; +pub use self::crawl::CrawlManifestFuture; diff --git a/src/engine/futures/analyze.rs b/src/engine/futures/analyze.rs deleted file mode 100644 index 16d7415..0000000 --- a/src/engine/futures/analyze.rs +++ /dev/null @@ -1,49 +0,0 @@ -use failure::Error; -use futures::{Future, Poll, Stream}; -use futures::stream::futures_unordered; - -use ::models::crates::{AnalyzedDependencies, CrateDeps}; - -use super::super::Engine; -use super::super::machines::analyzer::DependencyAnalyzer; - -pub struct AnalyzeDependenciesFuture { - inner: Box> -} - -impl AnalyzeDependenciesFuture { - pub fn new(engine: Engine, deps: CrateDeps) -> Self { - let future = engine.fetch_advisory_db().and_then(move |advisory_db| { - let analyzer = DependencyAnalyzer::new(&deps, Some(advisory_db)); - - let main_deps = deps.main.into_iter().filter_map(|(name, dep)| { - if dep.is_external() { Some(name) } else { None } - }); - let dev_deps = deps.dev.into_iter().filter_map(|(name, dep)| { - if dep.is_external() { Some(name) } else { None } - }); - let build_deps = deps.build.into_iter().filter_map(|(name, dep)| { - if dep.is_external() { Some(name) } else { None } - }); - - let release_futures = engine.fetch_releases(main_deps.chain(dev_deps).chain(build_deps)); - - futures_unordered(release_futures) - .fold(analyzer, |mut analyzer, releases| { analyzer.process(releases); Ok(analyzer) as Result<_, Error> }) - .map(|analyzer| analyzer.finalize()) - }); - - AnalyzeDependenciesFuture { - inner: Box::new(future) - } - } -} - -impl Future for AnalyzeDependenciesFuture { - type Item = AnalyzedDependencies; - type Error = Error; - - fn poll(&mut self) -> Poll { - self.inner.poll() - } -} diff --git a/src/engine/machines/analyzer.rs b/src/engine/machines/analyzer.rs index 4daca90..655e5b6 100644 --- a/src/engine/machines/analyzer.rs +++ b/src/engine/machines/analyzer.rs @@ -1,24 +1,31 @@ use std::sync::Arc; -use rustsec::db::AdvisoryDatabase; +use rustsec::database::{Database, Query}; use semver::Version; -use ::models::crates::{CrateDeps, CrateRelease, CrateName, AnalyzedDependency, AnalyzedDependencies}; +use crate::models::crates::{ + AnalyzedDependencies, AnalyzedDependency, CrateDeps, CrateName, CrateRelease, +}; pub struct DependencyAnalyzer { deps: AnalyzedDependencies, - advisory_db: Option> + advisory_db: Option>, } impl DependencyAnalyzer { - pub fn new(deps: &CrateDeps, advisory_db: Option>) -> DependencyAnalyzer { + pub fn new(deps: &CrateDeps, advisory_db: Option>) -> DependencyAnalyzer { DependencyAnalyzer { deps: AnalyzedDependencies::new(deps), - advisory_db + advisory_db, } } - fn process_single(name: &CrateName, dep: &mut AnalyzedDependency, ver: &Version, advisory_db: Option<&AdvisoryDatabase>) { + fn process_single( + name: &CrateName, + dep: &mut AnalyzedDependency, + ver: &Version, + advisory_db: Option<&Database>, + ) { if dep.required.matches(&ver) { if let Some(ref mut current_latest_that_matches) = dep.latest_that_matches { if *current_latest_that_matches < *ver { @@ -28,7 +35,14 @@ impl DependencyAnalyzer { dep.latest_that_matches = Some(ver.clone()); } - if !advisory_db.map(|db| db.find_vulns_for_crate(name.as_ref(), ver).is_empty()).unwrap_or(true) { + let name: rustsec::cargo_lock::Name = name.as_ref().parse().unwrap(); + let version: rustsec::cargo_lock::Version = ver.to_string().parse().unwrap(); + let query = Query::new().package_version(name, version); + + if !advisory_db + .map(|db| db.query(&query).is_empty()) + .unwrap_or(true) + { dep.insecure = true; } } @@ -43,17 +57,32 @@ impl DependencyAnalyzer { } } - pub fn process>(&mut self, releases: I) { + pub fn process>(&mut self, releases: I) { let advisory_db = self.advisory_db.as_ref().map(|r| r.as_ref()); for release in releases.into_iter().filter(|r| !r.yanked) { if let Some(main_dep) = self.deps.main.get_mut(&release.name) { - DependencyAnalyzer::process_single(&release.name, main_dep, &release.version, advisory_db) + DependencyAnalyzer::process_single( + &release.name, + main_dep, + &release.version, + advisory_db, + ) } if let Some(dev_dep) = self.deps.dev.get_mut(&release.name) { - DependencyAnalyzer::process_single(&release.name, dev_dep, &release.version, advisory_db) + DependencyAnalyzer::process_single( + &release.name, + dev_dep, + &release.version, + advisory_db, + ) } if let Some(build_dep) = self.deps.build.get_mut(&release.name) { - DependencyAnalyzer::process_single(&release.name, build_dep, &release.version, advisory_db) + DependencyAnalyzer::process_single( + &release.name, + build_dep, + &release.version, + advisory_db, + ) } } } @@ -65,75 +94,157 @@ impl DependencyAnalyzer { #[cfg(test)] mod tests { - use models::crates::{CrateDep, CrateDeps, CrateRelease}; - use super::DependencyAnalyzer; + use crate::models::crates::{CrateDep, CrateDeps, CrateRelease}; + + use super::*; #[test] fn tracks_latest_without_matching() { let mut deps = CrateDeps::default(); - deps.main.insert("hyper".parse().unwrap(), CrateDep::External("^0.11.0".parse().unwrap())); + deps.main.insert( + "hyper".parse().unwrap(), + CrateDep::External("^0.11.0".parse().unwrap()), + ); let mut analyzer = DependencyAnalyzer::new(&deps, None); analyzer.process(vec![ - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.0".parse().unwrap(), deps: Default::default(), yanked: false }, - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.1".parse().unwrap(), deps: Default::default(), yanked: false } + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.0".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.1".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, ]); let analyzed = analyzer.finalize(); - assert_eq!(analyzed.main.get("hyper").unwrap().latest_that_matches, None); - assert_eq!(analyzed.main.get("hyper").unwrap().latest, Some("0.10.1".parse().unwrap())); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest_that_matches, + None + ); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest, + Some("0.10.1".parse().unwrap()) + ); } #[test] fn tracks_latest_that_matches() { let mut deps = CrateDeps::default(); - deps.main.insert("hyper".parse().unwrap(), CrateDep::External("^0.10.0".parse().unwrap())); + deps.main.insert( + "hyper".parse().unwrap(), + CrateDep::External("^0.10.0".parse().unwrap()), + ); let mut analyzer = DependencyAnalyzer::new(&deps, None); analyzer.process(vec![ - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.0".parse().unwrap(), deps: Default::default(), yanked: false }, - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.1".parse().unwrap(), deps: Default::default(), yanked: false }, - CrateRelease { name: "hyper".parse().unwrap(), version: "0.11.0".parse().unwrap(), deps: Default::default(), yanked: false } + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.0".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.1".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.11.0".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, ]); let analyzed = analyzer.finalize(); - assert_eq!(analyzed.main.get("hyper").unwrap().latest_that_matches, Some("0.10.1".parse().unwrap())); - assert_eq!(analyzed.main.get("hyper").unwrap().latest, Some("0.11.0".parse().unwrap())); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest_that_matches, + Some("0.10.1".parse().unwrap()) + ); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest, + Some("0.11.0".parse().unwrap()) + ); } #[test] fn skips_yanked_releases() { let mut deps = CrateDeps::default(); - deps.main.insert("hyper".parse().unwrap(), CrateDep::External("^0.10.0".parse().unwrap())); + deps.main.insert( + "hyper".parse().unwrap(), + CrateDep::External("^0.10.0".parse().unwrap()), + ); let mut analyzer = DependencyAnalyzer::new(&deps, None); analyzer.process(vec![ - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.0".parse().unwrap(), deps: Default::default(), yanked: false }, - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.1".parse().unwrap(), deps: Default::default(), yanked: true }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.0".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.1".parse().unwrap(), + deps: Default::default(), + yanked: true, + }, ]); let analyzed = analyzer.finalize(); - assert_eq!(analyzed.main.get("hyper").unwrap().latest_that_matches, Some("0.10.0".parse().unwrap())); - assert_eq!(analyzed.main.get("hyper").unwrap().latest, Some("0.10.0".parse().unwrap())); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest_that_matches, + Some("0.10.0".parse().unwrap()) + ); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest, + Some("0.10.0".parse().unwrap()) + ); } #[test] fn skips_prereleases() { let mut deps = CrateDeps::default(); - deps.main.insert("hyper".parse().unwrap(), CrateDep::External("^0.10.0".parse().unwrap())); + deps.main.insert( + "hyper".parse().unwrap(), + CrateDep::External("^0.10.0".parse().unwrap()), + ); let mut analyzer = DependencyAnalyzer::new(&deps, None); analyzer.process(vec![ - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.0".parse().unwrap(), deps: Default::default(), yanked: false }, - CrateRelease { name: "hyper".parse().unwrap(), version: "0.10.1-alpha".parse().unwrap(), deps: Default::default(), yanked: false }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.0".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, + CrateRelease { + name: "hyper".parse().unwrap(), + version: "0.10.1-alpha".parse().unwrap(), + deps: Default::default(), + yanked: false, + }, ]); let analyzed = analyzer.finalize(); - assert_eq!(analyzed.main.get("hyper").unwrap().latest_that_matches, Some("0.10.0".parse().unwrap())); - assert_eq!(analyzed.main.get("hyper").unwrap().latest, Some("0.10.0".parse().unwrap())); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest_that_matches, + Some("0.10.0".parse().unwrap()) + ); + assert_eq!( + analyzed.main.get("hyper").unwrap().latest, + Some("0.10.0".parse().unwrap()) + ); } } diff --git a/src/engine/machines/crawler.rs b/src/engine/machines/crawler.rs index ac6bfae..a8ce0b9 100644 --- a/src/engine/machines/crawler.rs +++ b/src/engine/machines/crawler.rs @@ -1,49 +1,57 @@ use std::collections::HashMap; -use failure::Error; -use relative_path::RelativePathBuf; +use anyhow::{anyhow, ensure, Error}; use indexmap::IndexMap; +use relative_path::RelativePathBuf; -use ::parsers::manifest::parse_manifest_toml; -use ::models::crates::{CrateDep, CrateDeps, CrateName, CrateManifest}; +use crate::models::crates::{CrateDep, CrateDeps, CrateManifest, CrateName}; +use crate::parsers::manifest::parse_manifest_toml; pub struct ManifestCrawlerOutput { - pub crates: IndexMap + pub crates: IndexMap, } pub struct ManifestCrawlerStepOutput { - pub paths_of_interest: Vec + pub paths_of_interest: Vec, } pub struct ManifestCrawler { manifests: HashMap, - leaf_crates: IndexMap + leaf_crates: IndexMap, } impl ManifestCrawler { pub fn new() -> ManifestCrawler { ManifestCrawler { manifests: HashMap::new(), - leaf_crates: IndexMap::new() + leaf_crates: IndexMap::new(), } } - pub fn step(&mut self, path: RelativePathBuf, raw_manifest: String) -> Result { + pub fn step( + &mut self, + path: RelativePathBuf, + raw_manifest: String, + ) -> Result { let manifest = parse_manifest_toml(&raw_manifest)?; self.manifests.insert(path.clone(), manifest.clone()); let mut output = ManifestCrawlerStepOutput { - paths_of_interest: vec![] + paths_of_interest: vec![], }; match manifest { CrateManifest::Package(name, deps) => { self.process_package(&path, name, deps, &mut output); - }, + } CrateManifest::Workspace { members } => { self.process_workspace(&path, &members, &mut output); - }, - CrateManifest::Mixed { name, deps, members } => { + } + CrateManifest::Mixed { + name, + deps, + members, + } => { self.process_package(&path, name, deps, &mut output); self.process_workspace(&path, &members, &mut output); } @@ -52,15 +60,31 @@ impl ManifestCrawler { Ok(output) } - fn register_interest(&mut self, base_path: &RelativePathBuf, path: &RelativePathBuf, output: &mut ManifestCrawlerStepOutput) { + fn register_interest( + &mut self, + base_path: &RelativePathBuf, + path: &RelativePathBuf, + output: &mut ManifestCrawlerStepOutput, + ) { let full_path = base_path.join_normalized(path); if !self.manifests.contains_key(&full_path) { output.paths_of_interest.push(full_path); } } - fn process_package(&mut self, base_path: &RelativePathBuf, name: CrateName, deps: CrateDeps, output: &mut ManifestCrawlerStepOutput) { - for (_, dep) in deps.main.iter().chain(deps.dev.iter()).chain(deps.build.iter()) { + fn process_package( + &mut self, + base_path: &RelativePathBuf, + name: CrateName, + deps: CrateDeps, + output: &mut ManifestCrawlerStepOutput, + ) { + for (_, dep) in deps + .main + .iter() + .chain(deps.dev.iter()) + .chain(deps.build.iter()) + { if let &CrateDep::Internal(ref path) = dep { self.register_interest(base_path, path, output); } @@ -69,8 +93,13 @@ impl ManifestCrawler { self.leaf_crates.insert(name, deps); } - fn process_workspace(&mut self, base_path: &RelativePathBuf, members: &[RelativePathBuf], output: &mut ManifestCrawlerStepOutput) { - for mut path in members { + fn process_workspace( + &mut self, + base_path: &RelativePathBuf, + members: &[RelativePathBuf], + output: &mut ManifestCrawlerStepOutput, + ) { + for path in members { if !path.ends_with("*") { self.register_interest(base_path, path, output); } @@ -79,7 +108,7 @@ impl ManifestCrawler { pub fn finalize(self) -> ManifestCrawlerOutput { ManifestCrawlerOutput { - crates: self.leaf_crates + crates: self.leaf_crates, } } } @@ -89,8 +118,9 @@ mod tests { use relative_path::RelativePath; use semver::VersionReq; - use models::crates::CrateDep; - use super::ManifestCrawler; + use crate::models::crates::CrateDep; + + use super::*; #[test] fn simple_package_manifest() { @@ -99,7 +129,9 @@ mod tests { name = "simpleton" "#; let mut crawler = ManifestCrawler::new(); - let step_output = crawler.step("Cargo.toml".into(), manifest.to_string()).unwrap(); + let step_output = crawler + .step("Cargo.toml".into(), manifest.to_string()) + .unwrap(); assert_eq!(step_output.paths_of_interest.len(), 0); let output = crawler.finalize(); assert_eq!(output.crates.len(), 1); @@ -127,16 +159,24 @@ codegen = "0.0.1" let output = crawler.finalize(); assert_eq!(output.crates.len(), 1); assert_eq!(output.crates["more-complex"].main.len(), 2); - assert_eq!(output.crates["more-complex"].main.get("foo").unwrap(), - &CrateDep::External(VersionReq::parse("0.30.0").unwrap())); - assert_eq!(output.crates["more-complex"].main.get("bar").unwrap(), - &CrateDep::External(VersionReq::parse("1.2.0").unwrap())); + assert_eq!( + output.crates["more-complex"].main.get("foo").unwrap(), + &CrateDep::External(VersionReq::parse("0.30.0").unwrap()) + ); + assert_eq!( + output.crates["more-complex"].main.get("bar").unwrap(), + &CrateDep::External(VersionReq::parse("1.2.0").unwrap()) + ); assert_eq!(output.crates["more-complex"].dev.len(), 1); - assert_eq!(output.crates["more-complex"].dev.get("quickcheck").unwrap(), - &CrateDep::External(VersionReq::parse("0.5").unwrap())); + assert_eq!( + output.crates["more-complex"].dev.get("quickcheck").unwrap(), + &CrateDep::External(VersionReq::parse("0.5").unwrap()) + ); assert_eq!(output.crates["more-complex"].build.len(), 1); - assert_eq!(output.crates["more-complex"].build.get("codegen").unwrap(), - &CrateDep::External(VersionReq::parse("0.0.1").unwrap())); + assert_eq!( + output.crates["more-complex"].build.get("codegen").unwrap(), + &CrateDep::External(VersionReq::parse("0.0.1").unwrap()) + ); } #[test] @@ -226,10 +266,17 @@ features = ["use_std"] "#; let mut crawler = ManifestCrawler::new(); - let step_output = crawler.step("".into(), futures_manifest.to_string()).unwrap(); + let step_output = crawler + .step("".into(), futures_manifest.to_string()) + .unwrap(); assert_eq!(step_output.paths_of_interest.len(), 1); assert_eq!(step_output.paths_of_interest[0].as_str(), "futures-cpupool"); - let step_output = crawler.step("futures-cpupool".into(), futures_cpupool_manifest.to_string()).unwrap(); + let step_output = crawler + .step( + "futures-cpupool".into(), + futures_cpupool_manifest.to_string(), + ) + .unwrap(); assert_eq!(step_output.paths_of_interest.len(), 0); let output = crawler.finalize(); assert_eq!(output.crates.len(), 2); @@ -237,10 +284,20 @@ features = ["use_std"] assert_eq!(output.crates["futures"].dev.len(), 0); assert_eq!(output.crates["futures"].build.len(), 0); assert_eq!(output.crates["futures-cpupool"].main.len(), 2); - assert_eq!(output.crates["futures-cpupool"].main.get("num_cpus").unwrap(), - &CrateDep::External(VersionReq::parse("1.0").unwrap())); - assert_eq!(output.crates["futures-cpupool"].main.get("futures").unwrap(), - &CrateDep::Internal(RelativePath::new("..").to_relative_path_buf())); + assert_eq!( + output.crates["futures-cpupool"] + .main + .get("num_cpus") + .unwrap(), + &CrateDep::External(VersionReq::parse("1.0").unwrap()) + ); + assert_eq!( + output.crates["futures-cpupool"] + .main + .get("futures") + .unwrap(), + &CrateDep::Internal(RelativePath::new("..").to_relative_path_buf()) + ); assert_eq!(output.crates["futures-cpupool"].dev.len(), 0); assert_eq!(output.crates["futures-cpupool"].build.len(), 0); } diff --git a/src/engine/machines/mod.rs b/src/engine/machines/mod.rs index c04cbd9..a1f328e 100644 --- a/src/engine/machines/mod.rs +++ b/src/engine/machines/mod.rs @@ -1,2 +1,2 @@ -pub mod crawler; pub mod analyzer; +pub mod crawler; diff --git a/src/engine/mod.rs b/src/engine/mod.rs index 7988c8e..db55df5 100644 --- a/src/engine/mod.rs +++ b/src/engine/mod.rs @@ -4,33 +4,34 @@ use std::time::{Duration, Instant}; use cadence::prelude::*; use cadence::{MetricSink, NopMetricSink, StatsdClient}; -use failure::Error; -use futures::{Future, future}; +use anyhow::{anyhow, ensure, Error}; use futures::future::join_all; -use hyper::Client; +use futures::{future, Future}; use hyper::client::HttpConnector; +use hyper::Client; use hyper_tls::HttpsConnector; +use once_cell::sync::Lazy; use relative_path::{RelativePath, RelativePathBuf}; -use rustsec::db::AdvisoryDatabase; +use rustsec::database::Database; use semver::VersionReq; use slog::Logger; use tokio_service::Service; +use crate::utils::cache::Cache; + +use crate::models::crates::{AnalyzedDependencies, CrateName, CratePath, CrateRelease}; +use crate::models::repo::{RepoPath, Repository}; + +use crate::interactors::crates::{GetPopularCrates, QueryCrate}; +use crate::interactors::github::GetPopularRepos; +use crate::interactors::rustsec::FetchAdvisoryDatabase; +use crate::interactors::RetrieveFileAtPath; + +mod fut; mod machines; -mod futures; -use ::utils::cache::Cache; - -use ::models::repo::{Repository, RepoPath}; -use ::models::crates::{CrateName, CratePath, CrateRelease, AnalyzedDependencies}; - -use ::interactors::crates::{QueryCrate, GetPopularCrates}; -use ::interactors::RetrieveFileAtPath; -use ::interactors::github::GetPopularRepos; -use ::interactors::rustsec::FetchAdvisoryDatabase; - -use self::futures::AnalyzeDependenciesFuture; -use self::futures::CrawlManifestFuture; +use self::fut::AnalyzeDependenciesFuture; +use self::fut::CrawlManifestFuture; type HttpClient = Client>; @@ -44,7 +45,7 @@ pub struct Engine { get_popular_crates: Arc>>, get_popular_repos: Arc>>, retrieve_file_at_path: Arc>, - fetch_advisory_db: Arc>> + fetch_advisory_db: Arc>>, } impl Engine { @@ -52,18 +53,26 @@ impl Engine { let metrics = StatsdClient::from_sink("engine", NopMetricSink); let query_crate = Cache::new(QueryCrate(client.clone()), Duration::from_secs(300), 500); - let get_popular_crates = Cache::new(GetPopularCrates(client.clone()), Duration::from_secs(10), 1); - let get_popular_repos = Cache::new(GetPopularRepos(client.clone()), Duration::from_secs(10), 1); - let fetch_advisory_db = Cache::new(FetchAdvisoryDatabase(client.clone()), Duration::from_secs(300), 1); + let get_popular_crates = + Cache::new(GetPopularCrates(client.clone()), Duration::from_secs(10), 1); + let get_popular_repos = + Cache::new(GetPopularRepos(client.clone()), Duration::from_secs(10), 1); + let fetch_advisory_db = Cache::new( + FetchAdvisoryDatabase(client.clone()), + Duration::from_secs(300), + 1, + ); Engine { - client: client.clone(), logger, metrics, + client: client.clone(), + logger, + metrics, query_crate: Arc::new(query_crate), get_popular_crates: Arc::new(get_popular_crates), get_popular_repos: Arc::new(get_popular_repos), retrieve_file_at_path: Arc::new(RetrieveFileAtPath(client)), - fetch_advisory_db: Arc::new(fetch_advisory_db) + fetch_advisory_db: Arc::new(fetch_advisory_db), } } @@ -74,7 +83,7 @@ impl Engine { pub struct AnalyzeDependenciesOutcome { pub crates: Vec<(CrateName, AnalyzedDependencies)>, - pub duration: Duration + pub duration: Duration, } impl AnalyzeDependenciesOutcome { @@ -83,38 +92,42 @@ impl AnalyzeDependenciesOutcome { } pub fn any_insecure(&self) -> bool { - self.crates.iter().any(|&(_, ref deps)| deps.count_insecure() > 0) + self.crates + .iter() + .any(|&(_, ref deps)| deps.count_insecure() > 0) } pub fn outdated_ratio(&self) -> (usize, usize) { - self.crates.iter().fold((0, 0), |(outdated, total), &(_, ref deps)| { - (outdated + deps.count_outdated(), total + deps.count_total()) - }) + self.crates + .iter() + .fold((0, 0), |(outdated, total), &(_, ref deps)| { + (outdated + deps.count_outdated(), total + deps.count_total()) + }) } } impl Engine { - pub fn get_popular_repos(&self) -> - impl Future, Error=Error> - { - self.get_popular_repos.call(()) - .from_err().map(|repos| { - repos.iter() - .filter(|repo| !POPULAR_REPOS_BLACKLIST.contains(&repo.path)) - .cloned().collect() - }) + pub fn get_popular_repos(&self) -> impl Future, Error = Error> { + self.get_popular_repos.call(()).from_err().map(|repos| { + repos + .iter() + .filter(|repo| !POPULAR_REPO_BLOCK_LIST.contains(&repo.path)) + .cloned() + .collect() + }) } - pub fn get_popular_crates(&self) -> - impl Future, Error=Error> - { - self.get_popular_crates.call(()) - .from_err().map(|crates| crates.clone()) + pub fn get_popular_crates(&self) -> impl Future, Error = Error> { + self.get_popular_crates + .call(()) + .from_err() + .map(|crates| crates.clone()) } - pub fn analyze_repo_dependencies(&self, repo_path: RepoPath) -> - impl Future - { + pub fn analyze_repo_dependencies( + &self, + repo_path: RepoPath, + ) -> impl Future { let start = Instant::now(); let entry_point = RelativePath::new("/").to_relative_path_buf(); @@ -123,99 +136,125 @@ impl Engine { let engine = self.clone(); manifest_future.and_then(move |manifest_output| { let engine_for_analyze = engine.clone(); - let futures = manifest_output.crates.into_iter().map(move |(crate_name, deps)| { - let analyzed_deps_future = AnalyzeDependenciesFuture::new(engine_for_analyze.clone(), deps); + let futures = manifest_output + .crates + .into_iter() + .map(move |(crate_name, deps)| { + let analyzed_deps_future = + AnalyzeDependenciesFuture::new(engine_for_analyze.clone(), deps); - analyzed_deps_future.map(move |analyzed_deps| (crate_name, analyzed_deps)) - }); + analyzed_deps_future.map(move |analyzed_deps| (crate_name, analyzed_deps)) + }); join_all(futures).and_then(move |crates| { let duration = start.elapsed(); - engine.metrics.time_duration_with_tags("analyze_duration", duration) + engine + .metrics + .time_duration_with_tags("analyze_duration", duration) .with_tag("repo_site", repo_path.site.as_ref()) .with_tag("repo_qual", repo_path.qual.as_ref()) .with_tag("repo_name", repo_path.name.as_ref()) .send()?; - Ok(AnalyzeDependenciesOutcome { - crates, duration - }) + Ok(AnalyzeDependenciesOutcome { crates, duration }) }) }) } - pub fn analyze_crate_dependencies(&self, crate_path: CratePath) -> - impl Future - { + pub fn analyze_crate_dependencies( + &self, + crate_path: CratePath, + ) -> impl Future { let start = Instant::now(); let query_future = self.query_crate.call(crate_path.name.clone()).from_err(); let engine = self.clone(); query_future.and_then(move |query_response| { - match query_response.releases.iter().find(|release| release.version == crate_path.version) { - None => future::Either::A(future::err(format_err!("could not find crate release with version {}", crate_path.version))), + match query_response + .releases + .iter() + .find(|release| release.version == crate_path.version) + { + None => future::Either::A(future::err(anyhow!( + "could not find crate release with version {}", + crate_path.version + ))), Some(release) => { - let analyzed_deps_future = AnalyzeDependenciesFuture::new(engine.clone(), release.deps.clone()); + let analyzed_deps_future = + AnalyzeDependenciesFuture::new(engine.clone(), release.deps.clone()); future::Either::B(analyzed_deps_future.map(move |analyzed_deps| { let crates = vec![(crate_path.name, analyzed_deps)].into_iter().collect(); let duration = start.elapsed(); - AnalyzeDependenciesOutcome { - crates, duration - } + AnalyzeDependenciesOutcome { crates, duration } })) } } }) } - pub fn find_latest_crate_release(&self, name: CrateName, req: VersionReq) -> - impl Future, Error=Error> - { - self.query_crate.call(name).from_err().map(move |query_response| { - query_response.releases.iter() - .filter(|release| req.matches(&release.version)) - .max_by(|r1, r2| r1.version.cmp(&r2.version)) - .cloned() - }) + pub fn find_latest_crate_release( + &self, + name: CrateName, + req: VersionReq, + ) -> impl Future, Error = Error> { + self.query_crate + .call(name) + .from_err() + .map(move |query_response| { + query_response + .releases + .iter() + .filter(|release| req.matches(&release.version)) + .max_by(|r1, r2| r1.version.cmp(&r2.version)) + .cloned() + }) } - fn fetch_releases>(&self, names: I) -> - impl Iterator, Error=Error>> - { + fn fetch_releases>( + &self, + names: I, + ) -> impl Iterator, Error = Error>> { let engine = self.clone(); names.into_iter().map(move |name| { - engine.query_crate.call(name) + engine + .query_crate + .call(name) .from_err() .map(|resp| resp.releases.clone()) }) } - fn retrieve_manifest_at_path(&self, repo_path: &RepoPath, path: &RelativePathBuf) -> - impl Future - { + fn retrieve_manifest_at_path( + &self, + repo_path: &RepoPath, + path: &RelativePathBuf, + ) -> impl Future { let manifest_path = path.join(RelativePath::new("Cargo.toml")); - self.retrieve_file_at_path.call((repo_path.clone(), manifest_path)) + self.retrieve_file_at_path + .call((repo_path.clone(), manifest_path)) } - fn fetch_advisory_db(&self) -> - impl Future, Error=Error> - { - self.fetch_advisory_db.call(()).from_err().map(|db| db.clone()) + fn fetch_advisory_db(&self) -> impl Future, Error = Error> { + self.fetch_advisory_db + .call(()) + .from_err() + .map(|db| db.clone()) } } -lazy_static! { - static ref POPULAR_REPOS_BLACKLIST: HashSet = { - vec![ - RepoPath::from_parts("github", "rust-lang", "rust"), - RepoPath::from_parts("github", "google", "xi-editor"), - RepoPath::from_parts("github", "lk-geimfari", "awesomo"), - RepoPath::from_parts("github", "redox-os", "tfs"), - RepoPath::from_parts("github", "carols10cents", "rustlings"), - RepoPath::from_parts("github", "rust-unofficial", "awesome-rust") - ].into_iter().collect::, _>>().unwrap() - }; -} +static POPULAR_REPO_BLOCK_LIST: Lazy> = Lazy::new(|| { + vec![ + RepoPath::from_parts("github", "rust-lang", "rust"), + RepoPath::from_parts("github", "google", "xi-editor"), + RepoPath::from_parts("github", "lk-geimfari", "awesomo"), + RepoPath::from_parts("github", "redox-os", "tfs"), + RepoPath::from_parts("github", "carols10cents", "rustlings"), + RepoPath::from_parts("github", "rust-unofficial", "awesome-rust"), + ] + .into_iter() + .collect::, _>>() + .unwrap() +}); diff --git a/src/interactors/bitbucket.rs b/src/interactors/bitbucket.rs index d2f8401..8239c05 100644 --- a/src/interactors/bitbucket.rs +++ b/src/interactors/bitbucket.rs @@ -1,18 +1,19 @@ -use failure::Error; +use anyhow::{anyhow, ensure, Error}; use hyper::Uri; use relative_path::RelativePathBuf; -use ::models::repo::RepoPath; +use crate::models::repo::RepoPath; const BITBUCKET_USER_CONTENT_BASE_URI: &'static str = "https://bitbucket.org"; pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result { let path_str: &str = path.as_ref(); - Ok(format!("{}/{}/{}/raw/HEAD/{}", + Ok(format!( + "{}/{}/{}/raw/HEAD/{}", BITBUCKET_USER_CONTENT_BASE_URI, repo_path.qual.as_ref(), repo_path.name.as_ref(), path_str - ).parse::()?) + ) + .parse::()?) } - diff --git a/src/interactors/crates.rs b/src/interactors/crates.rs index 17c06e6..a25cc49 100644 --- a/src/interactors/crates.rs +++ b/src/interactors/crates.rs @@ -1,13 +1,13 @@ use std::str; -use failure::Error; -use futures::{Future, Stream, IntoFuture, future}; +use anyhow::{anyhow, ensure, Error}; +use futures::{future, Future, IntoFuture, Stream}; use hyper::{Error as HyperError, Method, Request, Response, Uri}; -use tokio_service::Service; use semver::{Version, VersionReq}; -use serde_json; +use serde::Deserialize; +use tokio_service::Service; -use ::models::crates::{CrateName, CrateRelease, CrateDeps, CrateDep, CratePath}; +use crate::models::crates::{CrateDep, CrateDeps, CrateName, CratePath, CrateRelease}; const CRATES_INDEX_BASE_URI: &str = "https://raw.githubusercontent.com/rust-lang/crates.io-index"; const CRATES_API_BASE_URI: &str = "https://crates.io/api/v1"; @@ -17,7 +17,7 @@ struct RegistryPackageDep { name: String, req: VersionReq, #[serde(default)] - kind: Option + kind: Option, } #[derive(Deserialize, Debug)] @@ -26,51 +26,63 @@ struct RegistryPackage { #[serde(default)] deps: Vec, #[serde(default)] - yanked: bool + yanked: bool, } -fn convert_pkgs(name: &CrateName, packages: Vec) -> Result { - let releases = packages.into_iter().map(|package| { - let mut deps = CrateDeps::default(); - for dep in package.deps { - match dep.kind.map(|k| k.clone()).unwrap_or_else(|| "normal".into()).as_ref() { - "normal" => - deps.main.insert(dep.name.parse()?, CrateDep::External(dep.req)), - "dev" => - deps.dev.insert(dep.name.parse()?, CrateDep::External(dep.req)), - _ => None - }; - } - Ok(CrateRelease { - name: name.clone(), - version: package.vers, - deps: deps, - yanked: package.yanked +fn convert_pkgs( + name: &CrateName, + packages: Vec, +) -> Result { + let releases = packages + .into_iter() + .map(|package| { + let mut deps = CrateDeps::default(); + for dep in package.deps { + match dep + .kind + .map(|k| k.clone()) + .unwrap_or_else(|| "normal".into()) + .as_ref() + { + "normal" => deps + .main + .insert(dep.name.parse()?, CrateDep::External(dep.req)), + "dev" => deps + .dev + .insert(dep.name.parse()?, CrateDep::External(dep.req)), + _ => None, + }; + } + Ok(CrateRelease { + name: name.clone(), + version: package.vers, + deps: deps, + yanked: package.yanked, + }) }) - }).collect::>()?; + .collect::>()?; - Ok(QueryCrateResponse { - releases: releases - }) + Ok(QueryCrateResponse { releases: releases }) } pub struct QueryCrateResponse { - pub releases: Vec + pub releases: Vec, } #[derive(Debug, Clone)] pub struct QueryCrate(pub S); impl Service for QueryCrate - where S: Service + Clone + 'static, - S::Future: 'static +where + S: Service + Clone + 'static, + S::Future: 'static, { type Request = CrateName; type Response = QueryCrateResponse; type Error = Error; - type Future = Box>; + type Future = Box>; - fn call(&self, crate_name: CrateName) -> Self::Future { + fn call(&self, crate_name: CrateName) -> Self::Future { let lower_name = crate_name.as_ref().to_lowercase(); let path = match lower_name.len() { @@ -80,21 +92,22 @@ impl Service for QueryCrate _ => format!("{}/{}/{}", &lower_name[0..2], &lower_name[2..4], lower_name), }; - let uri = try_future_box!(format!("{}/master/{}", CRATES_INDEX_BASE_URI, path) - .parse::()); + let uri = + try_future_box!(format!("{}/master/{}", CRATES_INDEX_BASE_URI, path).parse::()); let request = Request::new(Method::Get, uri.clone()); Box::new(self.0.call(request).from_err().and_then(move |response| { let status = response.status(); if !status.is_success() { - try_future!(Err(format_err!("Status code {} for URI {}", status, uri))); + try_future!(Err(anyhow!("Status code {} for URI {}", status, uri))); } let body_future = response.body().concat2().from_err(); let decode_future = body_future.and_then(move |body| { let string_body = str::from_utf8(body.as_ref())?; - let packages = string_body.lines() + let packages = string_body + .lines() .map(|s| s.trim()) .filter(|s| !s.is_empty()) .map(|s| serde_json::from_str::(s)) @@ -112,38 +125,48 @@ impl Service for QueryCrate #[derive(Deserialize)] struct SummaryResponseDetail { name: String, - max_version: Version + max_version: Version, } #[derive(Deserialize)] struct SummaryResponse { - most_downloaded: Vec + most_downloaded: Vec, } fn convert_summary(response: SummaryResponse) -> Result, Error> { - response.most_downloaded.into_iter().map(|detail| { - let name = detail.name.parse()?; - Ok(CratePath { name, version: detail.max_version }) - }).collect() + response + .most_downloaded + .into_iter() + .map(|detail| { + let name = detail.name.parse()?; + Ok(CratePath { + name, + version: detail.max_version, + }) + }) + .collect() } #[derive(Debug, Clone)] pub struct GetPopularCrates(pub S); impl Service for GetPopularCrates - where S: Service + Clone + 'static, - S::Future: 'static +where + S: Service + Clone + 'static, + S::Future: 'static, { type Request = (); type Response = Vec; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, _req: ()) -> Self::Future { let service = self.0.clone(); let uri_future = format!("{}/summary", CRATES_API_BASE_URI) - .parse::().into_future().from_err(); + .parse::() + .into_future() + .from_err(); Box::new(uri_future.and_then(move |uri| { let request = Request::new(Method::Get, uri.clone()); @@ -151,7 +174,11 @@ impl Service for GetPopularCrates service.call(request).from_err().and_then(move |response| { let status = response.status(); if !status.is_success() { - future::Either::A(future::err(format_err!("Status code {} for URI {}", status, uri))) + future::Either::A(future::err(anyhow!( + "Status code {} for URI {}", + status, + uri + ))) } else { let body_future = response.body().concat2().from_err(); let decode_future = body_future.and_then(|body| { diff --git a/src/interactors/github.rs b/src/interactors/github.rs index 8252ac0..e1e455a 100644 --- a/src/interactors/github.rs +++ b/src/interactors/github.rs @@ -1,58 +1,64 @@ -use failure::Error; +use anyhow::{anyhow, ensure, Error}; use futures::{Future, Stream}; -use hyper::{Error as HyperError, Method, Request, Response, Uri}; use hyper::header::UserAgent; +use hyper::{Error as HyperError, Method, Request, Response, Uri}; use relative_path::RelativePathBuf; +use serde::Deserialize; use tokio_service::Service; -use serde_json; -use ::models::repo::{Repository, RepoPath}; +use crate::models::repo::{RepoPath, Repository}; const GITHUB_API_BASE_URI: &'static str = "https://api.github.com"; const GITHUB_USER_CONTENT_BASE_URI: &'static str = "https://raw.githubusercontent.com"; pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result { let path_str: &str = path.as_ref(); - Ok(format!("{}/{}/{}/HEAD/{}", + Ok(format!( + "{}/{}/{}/HEAD/{}", GITHUB_USER_CONTENT_BASE_URI, repo_path.qual.as_ref(), repo_path.name.as_ref(), path_str - ).parse::()?) + ) + .parse::()?) } #[derive(Deserialize)] struct GithubSearchResponse { - items: Vec + items: Vec, } #[derive(Deserialize)] struct GithubRepo { name: String, owner: GithubOwner, - description: String + description: String, } #[derive(Deserialize)] struct GithubOwner { - login: String + login: String, } #[derive(Debug, Clone)] pub struct GetPopularRepos(pub S); impl Service for GetPopularRepos - where S: Service + Clone + 'static, - S::Future: 'static +where + S: Service + Clone + 'static, + S::Future: 'static, { type Request = (); type Response = Vec; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, _req: ()) -> Self::Future { - let uri = try_future_box!(format!("{}/search/repositories?q=language:rust&sort=stars", GITHUB_API_BASE_URI) - .parse::()); + let uri = try_future_box!(format!( + "{}/search/repositories?q=language:rust&sort=stars", + GITHUB_API_BASE_URI + ) + .parse::()); let mut request = Request::new(Method::Get, uri); request.headers_mut().set(UserAgent::new("deps.rs")); @@ -60,18 +66,31 @@ impl Service for GetPopularRepos Box::new(self.0.call(request).from_err().and_then(|response| { let status = response.status(); if !status.is_success() { - try_future!(Err(format_err!("Status code {} for popular repo search", status))); + try_future!(Err(anyhow!( + "Status code {} for popular repo search", + status + ))); } let body_future = response.body().concat2().from_err(); let decode_future = body_future .and_then(|body| serde_json::from_slice(body.as_ref()).map_err(|err| err.into())); - decode_future.and_then(|search_response: GithubSearchResponse| { - search_response.items.into_iter().map(|item| { - let path = RepoPath::from_parts("github", &item.owner.login, &item.name)?; - Ok(Repository { path, description: item.description }) - }).collect::, _>>() - }).into() + decode_future + .and_then(|search_response: GithubSearchResponse| { + search_response + .items + .into_iter() + .map(|item| { + let path = + RepoPath::from_parts("github", &item.owner.login, &item.name)?; + Ok(Repository { + path, + description: item.description, + }) + }) + .collect::, _>>() + }) + .into() })) } } diff --git a/src/interactors/gitlab.rs b/src/interactors/gitlab.rs index 25e5eac..2ea5a66 100644 --- a/src/interactors/gitlab.rs +++ b/src/interactors/gitlab.rs @@ -1,8 +1,8 @@ +use anyhow::{anyhow, ensure, Error}; use hyper::Uri; use relative_path::RelativePathBuf; -use failure::Error; -use ::models::repo::RepoPath; +use crate::models::repo::RepoPath; const GITLAB_USER_CONTENT_BASE_URI: &'static str = "https://gitlab.com"; @@ -15,10 +15,12 @@ pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result< } else { path_str }; - Ok(format!("{}/{}/{}/raw/HEAD/{}", + Ok(format!( + "{}/{}/{}/raw/HEAD/{}", GITLAB_USER_CONTENT_BASE_URI, repo_path.qual.as_ref(), repo_path.name.as_ref(), slash_path - ).parse::()?) + ) + .parse::()?) } diff --git a/src/interactors/mod.rs b/src/interactors/mod.rs index bf4288d..46b4d85 100644 --- a/src/interactors/mod.rs +++ b/src/interactors/mod.rs @@ -1,10 +1,10 @@ -use failure::Error; +use anyhow::{anyhow, ensure, Error}; use futures::{Future, Stream}; use hyper::{Error as HyperError, Method, Request, Response}; use relative_path::RelativePathBuf; use tokio_service::Service; -use ::models::repo::{RepoSite, RepoPath}; +use crate::models::repo::{RepoPath, RepoSite}; pub mod bitbucket; pub mod crates; @@ -16,26 +16,21 @@ pub mod rustsec; pub struct RetrieveFileAtPath(pub S); impl Service for RetrieveFileAtPath - where S: Service + Clone + 'static, - S::Future: 'static +where + S: Service + Clone + 'static, + S::Future: 'static, { type Request = (RepoPath, RelativePathBuf); type Response = String; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, req: Self::Request) -> Self::Future { let (repo_path, path) = req; let uri = match &repo_path.site { - &RepoSite::Github => { - try_future_box!(github::get_manifest_uri(&repo_path, &path)) - }, - &RepoSite::Gitlab => { - try_future_box!(gitlab::get_manifest_uri(&repo_path, &path)) - }, - &RepoSite::Bitbucket => { - try_future_box!(bitbucket::get_manifest_uri(&repo_path, &path)) - } + &RepoSite::Github => try_future_box!(github::get_manifest_uri(&repo_path, &path)), + &RepoSite::Gitlab => try_future_box!(gitlab::get_manifest_uri(&repo_path, &path)), + &RepoSite::Bitbucket => try_future_box!(bitbucket::get_manifest_uri(&repo_path, &path)), }; let request = Request::new(Method::Get, uri.clone()); @@ -43,7 +38,7 @@ impl Service for RetrieveFileAtPath Box::new(self.0.call(request).from_err().and_then(move |response| { let status = response.status(); if !status.is_success() { - try_future!(Err(format_err!("Status code {} for URI {}", status, uri))); + try_future!(Err(anyhow!("Status code {} for URI {}", status, uri))); } let body_future = response.body().concat2().from_err(); @@ -54,5 +49,3 @@ impl Service for RetrieveFileAtPath })) } } - - diff --git a/src/interactors/rustsec.rs b/src/interactors/rustsec.rs index b651c15..7fcec16 100644 --- a/src/interactors/rustsec.rs +++ b/src/interactors/rustsec.rs @@ -1,44 +1,75 @@ use std::str; use std::sync::Arc; -use failure::Error; -use futures::{Future, IntoFuture, Stream, future}; +use anyhow::{anyhow, ensure, Error}; +use futures::{future, future::done, Future, IntoFuture, Stream}; use hyper::{Error as HyperError, Method, Request, Response}; -use rustsec::ADVISORY_DB_URL; -use rustsec::db::AdvisoryDatabase; +use rustsec::database::Database; +use rustsec::repository::DEFAULT_URL; use tokio_service::Service; #[derive(Debug, Clone)] pub struct FetchAdvisoryDatabase(pub S); impl Service for FetchAdvisoryDatabase - where S: Service + Clone + 'static, - S::Future: 'static +where + S: Service + Clone + 'static, + S::Future: 'static, { type Request = (); - type Response = Arc; + type Response = Arc; type Error = Error; - type Future = Box>; + type Future = Box>; fn call(&self, _req: ()) -> Self::Future { let service = self.0.clone(); - let uri_future = ADVISORY_DB_URL.parse().into_future().from_err(); - - Box::new(uri_future.and_then(move |uri| { - let request = Request::new(Method::Get, uri); - - service.call(request).from_err().and_then(|response| { - let status = response.status(); - if !status.is_success() { - future::Either::A(future::err(format_err!("Status code {} when fetching advisory db", status))) - } else { - let body_future = response.body().concat2().from_err(); - let decode_future = body_future - .and_then(|body| Ok(Arc::new(AdvisoryDatabase::from_toml(str::from_utf8(&body)?)?))); - future::Either::B(decode_future) - } - }) - })) + Box::new(done( + rustsec::Database::fetch() + .map(|db| Arc::new(db)) + .map_err(|err| anyhow!("err fetching rustsec DB")), + )) } } + +// #[derive(Debug, Clone)] +// pub struct FetchAdvisoryDatabase(pub S); + +// impl Service for FetchAdvisoryDatabase +// where +// S: Service + Clone + 'static, +// S::Future: 'static, +// { +// type Request = (); +// type Response = Arc; +// type Error = Error; +// type Future = Box>; + +// fn call(&self, _req: ()) -> Self::Future { +// let service = self.0.clone(); + +// let uri_future = DEFAULT_URL.parse().into_future().from_err(); + +// Box::new(uri_future.and_then(move |uri| { +// let request = Request::new(Method::Get, uri); + +// service.call(request).from_err().and_then(|response| { +// let status = response.status(); +// if !status.is_success() { +// future::Either::A(future::err(anyhow!( +// "Status code {} when fetching advisory db", +// status +// ))) +// } else { +// let body_future = response.body().concat2().from_err(); +// let decode_future = body_future.and_then(|body| { +// Ok(Arc::new(Database::from_toml(str::from_utf8( +// &body, +// )?)?)) +// }); +// future::Either::B(decode_future) +// } +// }) +// })) +// } +// } diff --git a/src/main.rs b/src/main.rs index 873bbdd..0ea87b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,54 +1,32 @@ -#![feature(ascii_ctype)] -#![feature(conservative_impl_trait)] -#![feature(ip_constructors)] -#![feature(proc_macro)] +#![deny(rust_2018_idioms)] +#![allow(unused)] -extern crate badge; -extern crate cadence; -#[macro_use] extern crate failure; -#[macro_use] extern crate futures; -extern crate hyper; -extern crate hyper_tls; -extern crate indexmap; -#[macro_use] extern crate lazy_static; -extern crate lru_cache; -extern crate maud; -extern crate relative_path; -extern crate route_recognizer; -extern crate rustsec; -extern crate semver; -#[macro_use] extern crate serde_derive; -extern crate serde; -extern crate serde_json; -extern crate shared_failure; -#[macro_use] extern crate slog; -extern crate slog_json; -extern crate tokio_core; -extern crate tokio_service; -extern crate toml; -#[macro_use] extern crate try_future; -mod utils; -mod models; -mod parsers; -mod interactors; -mod engine; -mod server; +#[macro_use] +extern crate try_future; use std::env; -use std::net::{IpAddr, Ipv4Addr, UdpSocket, SocketAddr}; +use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; use std::sync::Mutex; use cadence::{QueuingMetricSink, UdpMetricSink}; use futures::{Future, Stream}; -use hyper::Client; use hyper::server::Http; +use hyper::Client; use hyper_tls::HttpsConnector; use slog::Drain; +use slog::{info, o}; use tokio_core::reactor::Core; -use self::server::Server; +mod engine; +mod interactors; +mod models; +mod parsers; +mod server; +mod utils; + use self::engine::Engine; +use self::server::Server; fn init_metrics() -> QueuingMetricSink { let socket = UdpSocket::bind("0.0.0.0:0").unwrap(); @@ -61,27 +39,27 @@ fn init_metrics() -> QueuingMetricSink { fn main() { let logger = slog::Logger::root( Mutex::new(slog_json::Json::default(std::io::stderr())).map(slog::Fuse), - o!("version" => env!("CARGO_PKG_VERSION")) + o!("version" => env!("CARGO_PKG_VERSION")), ); let metrics = init_metrics(); - let mut core = Core::new() - .expect("failed to create event loop"); + let mut core = Core::new().expect("failed to create event loop"); let handle = core.handle(); - let connector = HttpsConnector::new(4, &handle) - .expect("failed to create https connector"); + let connector = HttpsConnector::new(4, &handle).expect("failed to create https connector"); let client = Client::configure() .connector(connector) .build(&core.handle()); - let port = env::var("PORT").unwrap_or_else(|_| "8080".to_string()).parse() + let port = env::var("PORT") + .unwrap_or_else(|_| "8080".to_string()) + .parse() .expect("could not read port"); - let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::unspecified()), port); + let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), port); let http = Http::new(); @@ -90,7 +68,8 @@ fn main() { let server = Server::new(logger.clone(), engine); - let serve = http.serve_addr_handle(&addr, &handle, move || Ok(server.clone())) + let serve = http + .serve_addr_handle(&addr, &handle, move || Ok(server.clone())) .expect("failed to bind server"); let serving = serve.for_each(move |conn| { diff --git a/src/models/crates.rs b/src/models/crates.rs index 3fc60ed..28324cc 100644 --- a/src/models/crates.rs +++ b/src/models/crates.rs @@ -1,7 +1,7 @@ use std::borrow::Borrow; use std::str::FromStr; -use failure::Error; +use anyhow::{anyhow, ensure, Error}; use indexmap::IndexMap; use relative_path::RelativePathBuf; use semver::{Version, VersionReq}; @@ -9,14 +9,14 @@ use semver::{Version, VersionReq}; #[derive(Clone, Debug, Hash, PartialEq, Eq)] pub struct CratePath { pub name: CrateName, - pub version: Version + pub version: Version, } impl CratePath { pub fn from_parts(name: &str, version: &str) -> Result { Ok(CratePath { name: name.parse()?, - version: version.parse()? + version: version.parse()?, }) } } @@ -46,12 +46,12 @@ impl FromStr for CrateName { type Err = Error; fn from_str(input: &str) -> Result { - let is_valid = input.chars().all(|c| { - c.is_ascii_alphanumeric() || c == '_' || c == '-' - }); + let is_valid = input + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-'); if !is_valid { - Err(format_err!("failed to validate crate name: {}", input)) + Err(anyhow!("failed to validate crate name: {}", input)) } else { Ok(CrateName(input.to_string())) } @@ -63,13 +63,13 @@ pub struct CrateRelease { pub name: CrateName, pub version: Version, pub deps: CrateDeps, - pub yanked: bool + pub yanked: bool, } #[derive(Clone, Debug, PartialEq, Eq)] pub enum CrateDep { External(VersionReq), - Internal(RelativePathBuf) + Internal(RelativePathBuf), } impl CrateDep { @@ -86,7 +86,7 @@ impl CrateDep { pub struct CrateDeps { pub main: IndexMap, pub dev: IndexMap, - pub build: IndexMap + pub build: IndexMap, } #[derive(Debug)] @@ -94,7 +94,7 @@ pub struct AnalyzedDependency { pub required: VersionReq, pub latest_that_matches: Option, pub latest: Option, - pub insecure: bool + pub insecure: bool, } impl AnalyzedDependency { @@ -103,7 +103,7 @@ impl AnalyzedDependency { required, latest_that_matches: None, latest: None, - insecure: false + insecure: false, } } @@ -116,32 +116,44 @@ impl AnalyzedDependency { pub struct AnalyzedDependencies { pub main: IndexMap, pub dev: IndexMap, - pub build: IndexMap + pub build: IndexMap, } impl AnalyzedDependencies { pub fn new(deps: &CrateDeps) -> AnalyzedDependencies { - let main = deps.main.iter().filter_map(|(name, dep)| { - if let &CrateDep::External(ref req) = dep { - Some((name.clone(), AnalyzedDependency::new(req.clone()))) - } else { - None - } - }).collect(); - let dev = deps.dev.iter().filter_map(|(name, dep)| { - if let &CrateDep::External(ref req) = dep { - Some((name.clone(), AnalyzedDependency::new(req.clone()))) - } else { - None - } - }).collect(); - let build = deps.build.iter().filter_map(|(name, dep)| { - if let &CrateDep::External(ref req) = dep { - Some((name.clone(), AnalyzedDependency::new(req.clone()))) - } else { - None - } - }).collect(); + let main = deps + .main + .iter() + .filter_map(|(name, dep)| { + if let &CrateDep::External(ref req) = dep { + Some((name.clone(), AnalyzedDependency::new(req.clone()))) + } else { + None + } + }) + .collect(); + let dev = deps + .dev + .iter() + .filter_map(|(name, dep)| { + if let &CrateDep::External(ref req) = dep { + Some((name.clone(), AnalyzedDependency::new(req.clone()))) + } else { + None + } + }) + .collect(); + let build = deps + .build + .iter() + .filter_map(|(name, dep)| { + if let &CrateDep::External(ref req) = dep { + Some((name.clone(), AnalyzedDependency::new(req.clone()))) + } else { + None + } + }) + .collect(); AnalyzedDependencies { main, dev, build } } @@ -150,38 +162,35 @@ impl AnalyzedDependencies { } pub fn count_outdated(&self) -> usize { - let main_outdated = self.main.iter() + let main_outdated = self + .main + .iter() .filter(|&(_, dep)| dep.is_outdated()) .count(); - let dev_outdated = self.dev.iter() + let dev_outdated = self + .dev + .iter() .filter(|&(_, dep)| dep.is_outdated()) .count(); - let build_outdated = self.build.iter() + let build_outdated = self + .build + .iter() .filter(|&(_, dep)| dep.is_outdated()) .count(); main_outdated + dev_outdated + build_outdated } - pub fn count_insecure(&self) -> usize { - let main_insecure = self.main.iter() - .filter(|&(_, dep)| dep.insecure) - .count(); - let dev_insecure = self.dev.iter() - .filter(|&(_, dep)| dep.insecure) - .count(); - let build_insecure = self.build.iter() - .filter(|&(_, dep)| dep.insecure) - .count(); + pub fn count_insecure(&self) -> usize { + let main_insecure = self.main.iter().filter(|&(_, dep)| dep.insecure).count(); + let dev_insecure = self.dev.iter().filter(|&(_, dep)| dep.insecure).count(); + let build_insecure = self.build.iter().filter(|&(_, dep)| dep.insecure).count(); main_insecure + dev_insecure + build_insecure - } + } pub fn any_outdated(&self) -> bool { - let main_any_outdated = self.main.iter() - .any(|(_, dep)| dep.is_outdated()); - let dev_any_outdated = self.dev.iter() - .any(|(_, dep)| dep.is_outdated()); - let build_any_outdated = self.build.iter() - .any(|(_, dep)| dep.is_outdated()); + let main_any_outdated = self.main.iter().any(|(_, dep)| dep.is_outdated()); + let dev_any_outdated = self.dev.iter().any(|(_, dep)| dep.is_outdated()); + let build_any_outdated = self.build.iter().any(|(_, dep)| dep.is_outdated()); main_any_outdated || dev_any_outdated || build_any_outdated } } @@ -189,6 +198,12 @@ impl AnalyzedDependencies { #[derive(Clone, Debug)] pub enum CrateManifest { Package(CrateName, CrateDeps), - Workspace { members: Vec }, - Mixed { name: CrateName, deps: CrateDeps, members: Vec } + Workspace { + members: Vec, + }, + Mixed { + name: CrateName, + deps: CrateDeps, + members: Vec, + }, } diff --git a/src/models/mod.rs b/src/models/mod.rs index 5f3bd04..ea98907 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -3,5 +3,5 @@ pub mod repo; pub enum SubjectPath { Repo(self::repo::RepoPath), - Crate(self::crates::CratePath) + Crate(self::crates::CratePath), } diff --git a/src/models/repo.rs b/src/models/repo.rs index d6a7fd1..6b0adc8 100644 --- a/src/models/repo.rs +++ b/src/models/repo.rs @@ -1,18 +1,18 @@ use std::str::FromStr; -use failure::Error; +use anyhow::{anyhow, ensure, Error}; #[derive(Clone, Debug)] pub struct Repository { pub path: RepoPath, - pub description: String + pub description: String, } #[derive(Clone, Debug, Hash, PartialEq, Eq)] pub struct RepoPath { pub site: RepoSite, pub qual: RepoQualifier, - pub name: RepoName + pub name: RepoName, } impl RepoPath { @@ -20,7 +20,7 @@ impl RepoPath { Ok(RepoPath { site: site.parse()?, qual: qual.parse()?, - name: name.parse()? + name: name.parse()?, }) } } @@ -50,7 +50,7 @@ impl FromStr for RepoSite { "github" => Ok(RepoSite::Github), "gitlab" => Ok(RepoSite::Gitlab), "bitbucket" => Ok(RepoSite::Bitbucket), - _ => Err(format_err!("unknown repo site identifier")) + _ => Err(anyhow!("unknown repo site identifier")), } } } @@ -72,9 +72,9 @@ impl FromStr for RepoQualifier { type Err = Error; fn from_str(input: &str) -> Result { - let is_valid = input.chars().all(|c| { - c.is_ascii_alphanumeric() || c == '.' || c == '-' || c == '_' - }); + let is_valid = input + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '.' || c == '-' || c == '_'); ensure!(is_valid, "invalid repo qualifier"); Ok(RepoQualifier(input.to_string())) @@ -94,9 +94,9 @@ impl FromStr for RepoName { type Err = Error; fn from_str(input: &str) -> Result { - let is_valid = input.chars().all(|c| { - c.is_ascii_alphanumeric() || c == '.' || c == '-' || c == '_' - }); + let is_valid = input + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '.' || c == '-' || c == '_'); ensure!(is_valid, "invalid repo name"); Ok(RepoName(input.to_string())) diff --git a/src/parsers/manifest.rs b/src/parsers/manifest.rs index ab2e390..4cf4f89 100644 --- a/src/parsers/manifest.rs +++ b/src/parsers/manifest.rs @@ -1,34 +1,34 @@ -use failure::Error; +use anyhow::{anyhow, ensure, Error}; use indexmap::IndexMap; use relative_path::RelativePathBuf; use semver::VersionReq; -use toml; +use serde::{Deserialize, Serialize}; -use ::models::crates::{CrateName, CrateDep, CrateDeps, CrateManifest}; +use crate::models::crates::{CrateDep, CrateDeps, CrateManifest, CrateName}; #[derive(Serialize, Deserialize, Debug)] struct CargoTomlComplexDependency { git: Option, path: Option, - version: Option + version: Option, } #[derive(Serialize, Deserialize, Debug)] #[serde(untagged)] enum CargoTomlDependency { Simple(String), - Complex(CargoTomlComplexDependency) + Complex(CargoTomlComplexDependency), } #[derive(Serialize, Deserialize, Debug)] struct CargoTomlPackage { - name: String + name: String, } #[derive(Serialize, Deserialize, Debug)] struct CargoTomlWorkspace { #[serde(default)] - members: Vec + members: Vec, } #[derive(Serialize, Deserialize, Debug)] @@ -44,32 +44,42 @@ struct CargoToml { dev_dependencies: IndexMap, #[serde(rename = "build-dependencies")] #[serde(default)] - build_dependencies: IndexMap + build_dependencies: IndexMap, } -fn convert_dependency(cargo_dep: (String, CargoTomlDependency)) -> Option> { +fn convert_dependency( + cargo_dep: (String, CargoTomlDependency), +) -> Option> { match cargo_dep { - (name, CargoTomlDependency::Simple(string)) => { - Some(name.parse::().map_err(|err| err.into()).and_then(|parsed_name| { - string.parse::().map_err(|err| err.into()) - .map(|version| (parsed_name, CrateDep::External(version))) - })) - } + (name, CargoTomlDependency::Simple(string)) => Some( + name.parse::() + .map_err(|err| err.into()) + .and_then(|parsed_name| { + string + .parse::() + .map_err(|err| err.into()) + .map(|version| (parsed_name, CrateDep::External(version))) + }), + ), (name, CargoTomlDependency::Complex(cplx)) => { if cplx.git.is_some() { None } else if cplx.path.is_some() { cplx.path.map(|path| { - name.parse::().map_err(|err| err.into()).map(|parsed_name| { - (parsed_name, CrateDep::Internal(path)) - }) + name.parse::() + .map_err(|err| err.into()) + .map(|parsed_name| (parsed_name, CrateDep::Internal(path))) }) } else { cplx.version.map(|string| { - name.parse::().map_err(|err| err.into()).and_then(|parsed_name| { - string.parse::().map_err(|err| err.into()) - .map(|version| (parsed_name, CrateDep::External(version))) - }) + name.parse::() + .map_err(|err| err.into()) + .and_then(|parsed_name| { + string + .parse::() + .map_err(|err| err.into()) + .map(|version| (parsed_name, CrateDep::External(version))) + }) }) } } @@ -82,20 +92,29 @@ pub fn parse_manifest_toml(input: &str) -> Result { let mut package_part = None; let mut workspace_part = None; - if let Some(package) = cargo_toml.package { + if let Some(package) = cargo_toml.package { let crate_name = package.name.parse::()?; - let dependencies = cargo_toml.dependencies - .into_iter().filter_map(convert_dependency).collect::, _>>()?; - let dev_dependencies = cargo_toml.dev_dependencies - .into_iter().filter_map(convert_dependency).collect::, _>>()?; - let build_dependencies = cargo_toml.build_dependencies - .into_iter().filter_map(convert_dependency).collect::, _>>()?; + let dependencies = cargo_toml + .dependencies + .into_iter() + .filter_map(convert_dependency) + .collect::, _>>()?; + let dev_dependencies = cargo_toml + .dev_dependencies + .into_iter() + .filter_map(convert_dependency) + .collect::, _>>()?; + let build_dependencies = cargo_toml + .build_dependencies + .into_iter() + .filter_map(convert_dependency) + .collect::, _>>()?; let deps = CrateDeps { main: dependencies, dev: dev_dependencies, - build: build_dependencies + build: build_dependencies, }; package_part = Some((crate_name, deps)); @@ -106,21 +125,22 @@ pub fn parse_manifest_toml(input: &str) -> Result { } match (package_part, workspace_part) { - (Some((name, deps)), None) => - Ok(CrateManifest::Package(name, deps)), - (None, Some(members)) => - Ok(CrateManifest::Workspace { members }), - (Some((name, deps)), Some(members)) => - Ok(CrateManifest::Mixed { name, deps, members }), - (None, None) => - Err(format_err!("neither workspace nor package found in manifest")) + (Some((name, deps)), None) => Ok(CrateManifest::Package(name, deps)), + (None, Some(members)) => Ok(CrateManifest::Workspace { members }), + (Some((name, deps)), Some(members)) => Ok(CrateManifest::Mixed { + name, + deps, + members, + }), + (None, None) => Err(anyhow!("neither workspace nor package found in manifest")), } } #[cfg(test)] mod tests { - use models::crates::CrateManifest; - use super::parse_manifest_toml; + use crate::models::crates::CrateManifest; + + use super::*; #[test] fn parse_workspace_without_members_declaration() { @@ -136,14 +156,18 @@ symbolic-common = { version = "2.0.6", path = "common" } let manifest = parse_manifest_toml(toml).unwrap(); match manifest { - CrateManifest::Mixed { name, deps, members } => { + CrateManifest::Mixed { + name, + deps, + members, + } => { assert_eq!(name.as_ref(), "symbolic"); assert_eq!(deps.main.len(), 1); assert_eq!(deps.dev.len(), 0); assert_eq!(deps.build.len(), 0); assert_eq!(members.len(), 0); - }, - _ => panic!("expected mixed manifest") + } + _ => panic!("expected mixed manifest"), } } } diff --git a/src/server/assets.rs b/src/server/assets.rs index 2aad748..1f2666c 100644 --- a/src/server/assets.rs +++ b/src/server/assets.rs @@ -1,4 +1,2 @@ -pub static STATIC_STYLE_CSS: &'static str = - include_str!(concat!(env!("OUT_DIR"), "/style.css")); -pub static STATIC_FAVICON_PNG: &'static [u8; 1338] = - include_bytes!("../../assets/favicon.png"); +pub static STATIC_STYLE_CSS: &'static str = include_str!(concat!(env!("OUT_DIR"), "/style.css")); +pub static STATIC_FAVICON_PNG: &'static [u8; 1338] = include_bytes!("../../assets/favicon.png"); diff --git a/src/server/mod.rs b/src/server/mod.rs index 9d52d56..0326c05 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,32 +1,34 @@ use std::env; use std::sync::Arc; -use futures::{Future, IntoFuture, future}; -use hyper::{Error as HyperError, Method, Request, Response, StatusCode}; +use futures::{future, Future, IntoFuture}; use hyper::header::{ContentType, Location}; +use hyper::{Error as HyperError, Method, Request, Response, StatusCode}; +use once_cell::sync::Lazy; use route_recognizer::{Params, Router}; use semver::VersionReq; use slog::Logger; +use slog::{error, o}; use tokio_service::Service; mod assets; mod views; -use ::engine::{Engine, AnalyzeDependenciesOutcome}; -use ::models::crates::{CrateName, CratePath}; -use ::models::repo::RepoPath; -use ::models::SubjectPath; +use crate::engine::{AnalyzeDependenciesOutcome, Engine}; +use crate::models::crates::{CrateName, CratePath}; +use crate::models::repo::RepoPath; +use crate::models::SubjectPath; #[derive(Clone, Copy, PartialEq)] enum StatusFormat { Html, - Svg + Svg, } #[derive(Clone, Copy)] enum StaticFile { StyleCss, - FaviconPng + FaviconPng, } enum Route { @@ -34,14 +36,14 @@ enum Route { Static(StaticFile), RepoStatus(StatusFormat), CrateRedirect, - CrateStatus(StatusFormat) + CrateStatus(StatusFormat), } #[derive(Clone)] pub struct Server { logger: Logger, engine: Engine, - router: Arc> + router: Arc>, } impl Server { @@ -53,14 +55,30 @@ impl Server { router.add("/static/style.css", Route::Static(StaticFile::StyleCss)); router.add("/static/favicon.png", Route::Static(StaticFile::FaviconPng)); - router.add("/repo/:site/:qual/:name", Route::RepoStatus(StatusFormat::Html)); - router.add("/repo/:site/:qual/:name/status.svg", Route::RepoStatus(StatusFormat::Svg)); + router.add( + "/repo/:site/:qual/:name", + Route::RepoStatus(StatusFormat::Html), + ); + router.add( + "/repo/:site/:qual/:name/status.svg", + Route::RepoStatus(StatusFormat::Svg), + ); router.add("/crate/:name", Route::CrateRedirect); - router.add("/crate/:name/:version", Route::CrateStatus(StatusFormat::Html)); - router.add("/crate/:name/:version/status.svg", Route::CrateStatus(StatusFormat::Svg)); + router.add( + "/crate/:name/:version", + Route::CrateStatus(StatusFormat::Html), + ); + router.add( + "/crate/:name/:version/status.svg", + Route::CrateStatus(StatusFormat::Svg), + ); - Server { logger, engine, router: Arc::new(router) } + Server { + logger, + engine, + router: Arc::new(router), + } } } @@ -68,10 +86,12 @@ impl Service for Server { type Request = Request; type Response = Response; type Error = HyperError; - type Future = Box>; + type Future = Box>; fn call(&self, req: Request) -> Self::Future { - let logger = self.logger.new(o!("http_path" => req.uri().path().to_owned())); + let logger = self + .logger + .new(o!("http_path" => req.uri().path().to_owned())); if let Ok(route_match) = self.router.recognize(req.uri().path()) { match route_match.handler { @@ -79,28 +99,32 @@ impl Service for Server { if *req.method() == Method::Get { return Box::new(self.index(req, route_match.params, logger)); } - }, + } &Route::RepoStatus(format) => { if *req.method() == Method::Get { return Box::new(self.repo_status(req, route_match.params, logger, format)); } - }, + } &Route::CrateStatus(format) => { if *req.method() == Method::Get { - return Box::new(self.crate_status(req, route_match.params, logger, format)); + return Box::new(self.crate_status( + req, + route_match.params, + logger, + format, + )); } - }, + } &Route::CrateRedirect => { if *req.method() == Method::Get { return Box::new(self.crate_redirect(req, route_match.params, logger)); } - }, + } &Route::Static(file) => { if *req.method() == Method::Get { return Box::new(future::ok(Server::static_file(file))); } } - } } @@ -111,175 +135,216 @@ impl Service for Server { } impl Server { - fn index(&self, _req: Request, _params: Params, logger: Logger) -> - impl Future - { - self.engine.get_popular_repos() + fn index( + &self, + _req: Request, + _params: Params, + logger: Logger, + ) -> impl Future { + self.engine + .get_popular_repos() .join(self.engine.get_popular_crates()) - .then(move |popular_result| { - match popular_result { - Err(err) => { - error!(logger, "error: {}", err); - let mut response = views::html::error::render("Could not retrieve popular items", ""); - response.set_status(StatusCode::InternalServerError); - future::ok(response) - }, - Ok((popular_repos, popular_crates)) => - future::ok(views::html::index::render(popular_repos, popular_crates)) + .then(move |popular_result| match popular_result { + Err(err) => { + error!(logger, "error: {}", err); + let mut response = + views::html::error::render("Could not retrieve popular items", ""); + response.set_status(StatusCode::InternalServerError); + future::ok(response) + } + Ok((popular_repos, popular_crates)) => { + future::ok(views::html::index::render(popular_repos, popular_crates)) } }) } - fn repo_status(&self, _req: Request, params: Params, logger: Logger, format: StatusFormat) -> - impl Future - { + fn repo_status( + &self, + _req: Request, + params: Params, + logger: Logger, + format: StatusFormat, + ) -> impl Future { let server = self.clone(); let site = params.find("site").expect("route param 'site' not found"); let qual = params.find("qual").expect("route param 'qual' not found"); let name = params.find("name").expect("route param 'name' not found"); - RepoPath::from_parts(site, qual, name).into_future().then(move |repo_path_result| { - match repo_path_result { + RepoPath::from_parts(site, qual, name) + .into_future() + .then(move |repo_path_result| match repo_path_result { Err(err) => { error!(logger, "error: {}", err); - let mut response = views::html::error::render("Could not parse repository path", - "Please make sure to provide a valid repository path."); + let mut response = views::html::error::render( + "Could not parse repository path", + "Please make sure to provide a valid repository path.", + ); response.set_status(StatusCode::BadRequest); future::Either::A(future::ok(response)) - }, - Ok(repo_path) => { - future::Either::B(server.engine.analyze_repo_dependencies(repo_path.clone()).then(move |analyze_result| { - match analyze_result { + } + Ok(repo_path) => future::Either::B( + server + .engine + .analyze_repo_dependencies(repo_path.clone()) + .then(move |analyze_result| match analyze_result { Err(err) => { error!(logger, "error: {}", err); - let response = Server::status_format_analysis(None, format, SubjectPath::Repo(repo_path)); - future::ok(response) - }, - Ok(analysis_outcome) => { - let response = Server::status_format_analysis(Some(analysis_outcome), format, SubjectPath::Repo(repo_path)); + let response = Server::status_format_analysis( + None, + format, + SubjectPath::Repo(repo_path), + ); future::ok(response) } - } - })) - } - } - }) + Ok(analysis_outcome) => { + let response = Server::status_format_analysis( + Some(analysis_outcome), + format, + SubjectPath::Repo(repo_path), + ); + future::ok(response) + } + }), + ), + }) } - fn crate_redirect(&self, _req: Request, params: Params, logger: Logger) -> - impl Future - { + fn crate_redirect( + &self, + _req: Request, + params: Params, + logger: Logger, + ) -> impl Future { let engine = self.engine.clone(); let name = params.find("name").expect("route param 'name' not found"); - name.parse::().into_future().then(move |crate_name_result| { - match crate_name_result { + name.parse::() + .into_future() + .then(move |crate_name_result| match crate_name_result { Err(err) => { error!(logger, "error: {}", err); - let mut response = views::html::error::render("Could not parse crate name", - "Please make sure to provide a valid crate name."); + let mut response = views::html::error::render( + "Could not parse crate name", + "Please make sure to provide a valid crate name.", + ); response.set_status(StatusCode::BadRequest); future::Either::A(future::ok(response)) - }, - Ok(crate_name) => { - future::Either::B(engine.find_latest_crate_release(crate_name, VersionReq::any()).then(move |release_result| { - match release_result { + } + Ok(crate_name) => future::Either::B( + engine + .find_latest_crate_release(crate_name, VersionReq::any()) + .then(move |release_result| match release_result { Err(err) => { error!(logger, "error: {}", err); - let mut response = views::html::error::render("Could not fetch crate information", - "Please make sure to provide a valid crate name."); + let mut response = views::html::error::render( + "Could not fetch crate information", + "Please make sure to provide a valid crate name.", + ); response.set_status(StatusCode::NotFound); future::ok(response) - }, + } Ok(None) => { - let mut response = views::html::error::render("Could not fetch crate information", - "Please make sure to provide a valid crate name."); + let mut response = views::html::error::render( + "Could not fetch crate information", + "Please make sure to provide a valid crate name.", + ); response.set_status(StatusCode::NotFound); future::ok(response) - }, + } Ok(Some(release)) => { let mut response = Response::new(); response.set_status(StatusCode::TemporaryRedirect); - let url = format!("{}/crate/{}/{}", + let url = format!( + "{}/crate/{}/{}", &SELF_BASE_URL as &str, release.name.as_ref(), - release.version); + release.version + ); response.headers_mut().set(Location::new(url)); future::ok(response) } - } - })) - } - } - }) + }), + ), + }) } - fn crate_status(&self, _req: Request, params: Params, logger: Logger, format: StatusFormat) -> - impl Future - { + fn crate_status( + &self, + _req: Request, + params: Params, + logger: Logger, + format: StatusFormat, + ) -> impl Future { let server = self.clone(); let name = params.find("name").expect("route param 'name' not found"); - let version = params.find("version").expect("route param 'version' not found"); + let version = params + .find("version") + .expect("route param 'version' not found"); - CratePath::from_parts(name, version).into_future().then(move |crate_path_result| { - match crate_path_result { + CratePath::from_parts(name, version) + .into_future() + .then(move |crate_path_result| match crate_path_result { Err(err) => { error!(logger, "error: {}", err); - let mut response = views::html::error::render("Could not parse crate path", - "Please make sure to provide a valid crate name and version."); + let mut response = views::html::error::render( + "Could not parse crate path", + "Please make sure to provide a valid crate name and version.", + ); response.set_status(StatusCode::BadRequest); future::Either::A(future::ok(response)) - }, - Ok(crate_path) => { - future::Either::B(server.engine.analyze_crate_dependencies(crate_path.clone()).then(move |analyze_result| { - match analyze_result { + } + Ok(crate_path) => future::Either::B( + server + .engine + .analyze_crate_dependencies(crate_path.clone()) + .then(move |analyze_result| match analyze_result { Err(err) => { error!(logger, "error: {}", err); - let response = Server::status_format_analysis(None, format, SubjectPath::Crate(crate_path)); - future::ok(response) - }, - Ok(analysis_outcome) => { - let response = Server::status_format_analysis(Some(analysis_outcome), format, SubjectPath::Crate(crate_path)); + let response = Server::status_format_analysis( + None, + format, + SubjectPath::Crate(crate_path), + ); future::ok(response) } - } - })) - } - } - }) + Ok(analysis_outcome) => { + let response = Server::status_format_analysis( + Some(analysis_outcome), + format, + SubjectPath::Crate(crate_path), + ); + future::ok(response) + } + }), + ), + }) } - fn status_format_analysis(analysis_outcome: Option, format: StatusFormat, subject_path: SubjectPath) -> Response { + fn status_format_analysis( + analysis_outcome: Option, + format: StatusFormat, + subject_path: SubjectPath, + ) -> Response { match format { - StatusFormat::Svg => - views::badge::response(analysis_outcome.as_ref()), - StatusFormat::Html => - views::html::status::render(analysis_outcome, subject_path) + StatusFormat::Svg => views::badge::response(analysis_outcome.as_ref()), + StatusFormat::Html => views::html::status::render(analysis_outcome, subject_path), } } fn static_file(file: StaticFile) -> Response { match file { - StaticFile::StyleCss => { - Response::new() - .with_header(ContentType("text/css".parse().unwrap())) - .with_body(assets::STATIC_STYLE_CSS) - }, - StaticFile::FaviconPng => { - Response::new() - .with_header(ContentType("image/png".parse().unwrap())) - .with_body(assets::STATIC_FAVICON_PNG.to_vec()) - } + StaticFile::StyleCss => Response::new() + .with_header(ContentType("text/css".parse().unwrap())) + .with_body(assets::STATIC_STYLE_CSS), + StaticFile::FaviconPng => Response::new() + .with_header(ContentType("image/png".parse().unwrap())) + .with_body(assets::STATIC_FAVICON_PNG.to_vec()), } } } -lazy_static! { - static ref SELF_BASE_URL: String = { - env::var("BASE_URL") - .unwrap_or_else(|_| "http://localhost:8080".to_string()) - }; -} +static SELF_BASE_URL: Lazy = + Lazy::new(|| env::var("BASE_URL").unwrap_or_else(|_| "http://localhost:8080".to_string())); diff --git a/src/server/views/badge.rs b/src/server/views/badge.rs index cb9139c..2c03a17 100644 --- a/src/server/views/badge.rs +++ b/src/server/views/badge.rs @@ -1,8 +1,8 @@ use badge::{Badge, BadgeOptions}; -use hyper::Response; use hyper::header::ContentType; +use hyper::Response; -use ::engine::AnalyzeDependenciesOutcome; +use crate::engine::AnalyzeDependenciesOutcome; pub fn badge(analysis_outcome: Option<&AnalyzeDependenciesOutcome>) -> Badge { let opts = match analysis_outcome { @@ -11,7 +11,7 @@ pub fn badge(analysis_outcome: Option<&AnalyzeDependenciesOutcome>) -> Badge { BadgeOptions { subject: "dependencies".into(), status: "insecure".into(), - color: "#e05d44".into() + color: "#e05d44".into(), } } else { let (outdated, total) = outcome.outdated_ratio(); @@ -20,30 +20,28 @@ pub fn badge(analysis_outcome: Option<&AnalyzeDependenciesOutcome>) -> Badge { BadgeOptions { subject: "dependencies".into(), status: format!("{} of {} outdated", outdated, total), - color: "#dfb317".into() + color: "#dfb317".into(), } } else if total > 0 { BadgeOptions { subject: "dependencies".into(), status: "up to date".into(), - color: "#4c1".into() + color: "#4c1".into(), } } else { BadgeOptions { subject: "dependencies".into(), status: "none".into(), - color: "#4c1".into() + color: "#4c1".into(), } } } - }, - None => { - BadgeOptions { - subject: "dependencies".into(), - status: "unknown".into(), - color: "#9f9f9f".into() - } } + None => BadgeOptions { + subject: "dependencies".into(), + status: "unknown".into(), + color: "#9f9f9f".into(), + }, }; Badge::new(opts) diff --git a/src/server/views/html/error.rs b/src/server/views/html/error.rs index 554c14a..4a668a4 100644 --- a/src/server/views/html/error.rs +++ b/src/server/views/html/error.rs @@ -1,19 +1,22 @@ use hyper::Response; use maud::html; -pub fn render(title: &str, descr: &str) -> Response { - super::render_html(title, html! { - section class="hero is-light" { - div class="hero-head" (super::render_navbar()) - } - section class="section" { - div class="container" { - div class="notification is-danger" { - p class="title is-3" (title) - p (descr) +pub fn render(title: &str, descr: &str) -> Response { + super::render_html( + title, + html! { + section class="hero is-light" { + div class="hero-head" { (super::render_navbar()) } + } + section class="section" { + div class="container" { + div class="notification is-danger" { + p class="title is-3" { (title) } + p { (descr) } + } } } - } - (super::render_footer(None)) - }) + (super::render_footer(None)) + }, + ) } diff --git a/src/server/views/html/index.rs b/src/server/views/html/index.rs index 41e1605..bc413b3 100644 --- a/src/server/views/html/index.rs +++ b/src/server/views/html/index.rs @@ -1,20 +1,20 @@ use hyper::Response; -use maud::{Markup, html}; +use maud::{html, Markup}; -use ::models::repo::Repository; -use ::models::crates::CratePath; +use crate::models::crates::CratePath; +use crate::models::repo::Repository; fn popular_table(popular_repos: Vec, popular_crates: Vec) -> Markup { html! { div class="columns" { div class="column" { - h2 class="title is-3" "Popular Repositories" + h2 class="title is-3" { "Popular Repositories" } table class="table is-fullwidth is-striped is-hoverable" { thead { tr { - th "Repository" - th class="has-text-right" "Status" + th { "Repository" } + th class="has-text-right" { "Status" } } } tbody { @@ -34,13 +34,13 @@ fn popular_table(popular_repos: Vec, popular_crates: Vec) } } div class="column" { - h2 class="title is-3" "Popular Crates" + h2 class="title is-3" { "Popular Crates" } table class="table is-fullwidth is-striped is-hoverable" { thead { tr { - th "Crate" - th class="has-text-right" "Status" + th { "Crate" } + th class="has-text-right" { "Status" } } } tbody { @@ -64,23 +64,26 @@ fn popular_table(popular_repos: Vec, popular_crates: Vec) } pub fn render(popular_repos: Vec, popular_crates: Vec) -> Response { - super::render_html("Keep your dependencies up-to-date", html! { - section class="hero is-light" { - div class="hero-head" (super::render_navbar()) - div class="hero-body" { - div class="container" { - p class="title is-1" "Keep your dependencies up-to-date" - p { - "Deps.rs uses semantic versioning to detect outdated or insecure dependencies in your project's" - code "Cargo.toml" - "." + super::render_html( + "Keep your dependencies up-to-date", + html! { + section class="hero is-light" { + div class="hero-head" { (super::render_navbar()) } + div class="hero-body" { + div class="container" { + p class="title is-1" { "Keep your dependencies up-to-date" } + p { + "Deps.rs uses semantic versioning to detect outdated or insecure dependencies in your project's" + code { "Cargo.toml" } + "." + } } } } - } - section class="section" { - div class="container" (popular_table(popular_repos, popular_crates)) - } - (super::render_footer(None)) - }) + section class="section" { + div class="container" { (popular_table(popular_repos, popular_crates)) } + } + (super::render_footer(None)) + }, + ) } diff --git a/src/server/views/html/mod.rs b/src/server/views/html/mod.rs index 14b21fe..be800ac 100644 --- a/src/server/views/html/mod.rs +++ b/src/server/views/html/mod.rs @@ -1,11 +1,11 @@ use std::time::Duration; -use hyper::Response; use hyper::header::ContentType; -use maud::{Markup, Render, html}; +use hyper::Response; +use maud::{html, Markup, Render}; -pub mod index; pub mod error; +pub mod index; pub mod status; use super::super::SELF_BASE_URL; @@ -16,14 +16,14 @@ fn render_html(title: &str, body: B) -> Response { head { meta charset="utf-8"; meta name="viewport" content="width=device-width, initial-scale=1"; - title (format!("{} - Deps.rs", title)) + title { (format!("{} - Deps.rs", title)) } link rel="icon" type="image/png" href="/static/favicon.png"; link rel="stylesheet" type="text/css" href="/static/style.css"; link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600"; link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Code+Pro"; link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"; } - body (body) + body { (body) } } }; @@ -38,7 +38,7 @@ fn render_navbar() -> Markup { div class="container" { div class="navbar-brand" { a class="navbar-item is-dark" href=(SELF_BASE_URL) { - h1 class="title is-3" "Deps.rs" + h1 class="title is-3" { "Deps.rs" } } } } @@ -47,25 +47,26 @@ fn render_navbar() -> Markup { } fn render_footer(duration: Option) -> Markup { - let duration_millis = duration.map(|d| d.as_secs() * 1000 + (d.subsec_nanos() / 1000 / 1000) as u64); + let duration_millis = + duration.map(|d| d.as_secs() * 1000 + (d.subsec_nanos() / 1000 / 1000) as u64); html! { footer class="footer" { div class="container" { div class="content has-text-centered" { p { - strong "Deps.rs" + strong { "Deps.rs" } " is a service for the Rust community. It is open source on " - a href="https://github.com/srijs/deps.rs" "GitHub" + a href="https://github.com/srijs/deps.rs" { "GitHub" } "." } p { "Please report any issues on the " - a href="https://github.com/srijs/deps.rs/issues" "issue tracker" + a href="https://github.com/srijs/deps.rs/issues" { "issue tracker" } "." } @if let Some(millis) = duration_millis { - p class="has-text-grey is-size-7" (format!("(rendered in {} ms)", millis)) + p class="has-text-grey is-size-7" { (format!("(rendered in {} ms)", millis)) } } } } diff --git a/src/server/views/html/status.rs b/src/server/views/html/status.rs index 91b83be..7b7971d 100644 --- a/src/server/views/html/status.rs +++ b/src/server/views/html/status.rs @@ -1,11 +1,11 @@ use hyper::Response; -use maud::{Markup, html}; use indexmap::IndexMap; +use maud::{html, Markup}; -use ::engine::AnalyzeDependenciesOutcome; -use ::models::crates::{CrateName, AnalyzedDependency, AnalyzedDependencies}; -use ::models::SubjectPath; -use ::models::repo::RepoSite; +use crate::engine::AnalyzeDependenciesOutcome; +use crate::models::crates::{AnalyzedDependencies, AnalyzedDependency, CrateName}; +use crate::models::repo::RepoSite; +use crate::models::SubjectPath; use super::super::badge; @@ -13,11 +13,11 @@ fn dependency_tables(crate_name: CrateName, deps: AnalyzedDependencies) -> Marku html! { h2 class="title is-3" { "Crate " - code (crate_name.as_ref()) + code { (crate_name.as_ref()) } } @if deps.main.is_empty() && deps.dev.is_empty() && deps.build.is_empty() { - p class="notification has-text-centered" "No external dependencies! 🙌" + p class="notification has-text-centered" { "No external dependencies! 🙌" } } @if !deps.main.is_empty() { @@ -40,7 +40,7 @@ fn dependency_table(title: &str, deps: IndexMap) let count_outdated = deps.iter().filter(|&(_, dep)| dep.is_outdated()).count(); html! { - h3 class="title is-4" (title) + h3 class="title is-4" { (title) } p class="subtitle is-5" { @if count_insecure > 0 { (format!(" ({} total, {} insecure)", count_total, count_insecure)) @@ -54,33 +54,33 @@ fn dependency_table(title: &str, deps: IndexMap) table class="table is-fullwidth is-striped is-hoverable" { thead { tr { - th "Crate" - th class="has-text-right" "Required" - th class="has-text-right" "Latest" - th class="has-text-right" "Status" + th { "Crate" } + th class="has-text-right" { "Required" } + th class="has-text-right" { "Latest" } + th class="has-text-right" { "Status" } } } tbody { @for (name, dep) in deps { tr { td { - a href=(format!("https://crates.io/crates/{}", name.as_ref())) (name.as_ref()) + a href=(format!("https://crates.io/crates/{}", name.as_ref())) { (name.as_ref()) } } - td class="has-text-right" code (dep.required.to_string()) + td class="has-text-right" { code { (dep.required.to_string()) } } td class="has-text-right" { @if let Some(ref latest) = dep.latest { - code (latest.to_string()) + code { (latest.to_string()) } } @else { "N/A" } } td class="has-text-right" { @if dep.insecure { - span class="tag is-danger" "insecure" + span class="tag is-danger" { "insecure" } } @else if dep.is_outdated() { - span class="tag is-warning" "out of date" + span class="tag is-warning" { "out of date" } } @else { - span class="tag is-success" "up to date" + span class="tag is-success" { "up to date" } } } } @@ -94,7 +94,7 @@ fn get_site_icon(site: &RepoSite) -> &'static str { match *site { RepoSite::Github => "fa-github", RepoSite::Gitlab => "fa-gitlab", - RepoSite::Bitbucket => "fa-bitbucket" + RepoSite::Bitbucket => "fa-bitbucket", } } @@ -104,15 +104,15 @@ fn render_title(subject_path: &SubjectPath) -> Markup { let site_icon = get_site_icon(&repo_path.site); html! { a href=(format!("{}/{}/{}", repo_path.site.to_base_uri(), repo_path.qual.as_ref(), repo_path.name.as_ref())) { - i class=(format!("fa {}", site_icon)) "" + i class=(format!("fa {}", site_icon)) { "" } (format!(" {} / {}", repo_path.qual.as_ref(), repo_path.name.as_ref())) } } - }, + } SubjectPath::Crate(ref crate_path) => { html! { a href=(format!("https://crates.io/crates/{}/{}", crate_path.name.as_ref(), crate_path.version)) { - i class="fa fa-cube" "" + i class="fa fa-cube" { "" } (format!(" {} {}", crate_path.name.as_ref(), crate_path.version)) } } @@ -123,7 +123,7 @@ fn render_title(subject_path: &SubjectPath) -> Markup { fn render_failure(subject_path: SubjectPath) -> Markup { html! { section class="hero is-light" { - div class="hero-head" (super::render_navbar()) + div class="hero-head" { (super::render_navbar()) } div class="hero-body" { div class="container" { h1 class="title is-1" { @@ -135,8 +135,8 @@ fn render_failure(subject_path: SubjectPath) -> Markup { section class="section" { div class="container" { div class="notification is-danger" { - h2 class="title is-3" "Failed to analyze repository" - p "The repository you requested might be structured in an uncommon way that is not yet supported." + h2 class="title is-3" { "Failed to analyze repository" } + p { "The repository you requested might be structured in an uncommon way that is not yet supported." } } } } @@ -144,18 +144,26 @@ fn render_failure(subject_path: SubjectPath) -> Markup { } } -fn render_success(analysis_outcome: AnalyzeDependenciesOutcome, subject_path: SubjectPath) -> Markup { +fn render_success( + analysis_outcome: AnalyzeDependenciesOutcome, + subject_path: SubjectPath, +) -> Markup { let self_path = match subject_path { - SubjectPath::Repo(ref repo_path) => - format!("repo/{}/{}/{}", repo_path.site.as_ref(), repo_path.qual.as_ref(), repo_path.name.as_ref()), - SubjectPath::Crate(ref crate_path) => + SubjectPath::Repo(ref repo_path) => format!( + "repo/{}/{}/{}", + repo_path.site.as_ref(), + repo_path.qual.as_ref(), + repo_path.name.as_ref() + ), + SubjectPath::Crate(ref crate_path) => { format!("crate/{}/{}", crate_path.name.as_ref(), crate_path.version) + } }; let status_base_url = format!("{}/{}", &super::SELF_BASE_URL as &str, self_path); let status_data_uri = badge::badge(Some(&analysis_outcome)).to_svg_data_uri(); - let hero_class = if analysis_outcome.any_insecure() { + let hero_class = if analysis_outcome.any_insecure() { "is-danger" } else if analysis_outcome.any_outdated() { "is-warning" @@ -165,7 +173,7 @@ fn render_success(analysis_outcome: AnalyzeDependenciesOutcome, subject_path: Su html! { section class=(format!("hero {}", hero_class)) { - div class="hero-head" (super::render_navbar()) + div class="hero-head" { (super::render_navbar()) } div class="hero-body" { div class="container" { h1 class="title is-1" { @@ -194,12 +202,17 @@ fn render_success(analysis_outcome: AnalyzeDependenciesOutcome, subject_path: Su } } -pub fn render(analysis_outcome: Option, subject_path: SubjectPath) -> Response { +pub fn render( + analysis_outcome: Option, + subject_path: SubjectPath, +) -> Response { let title = match subject_path { - SubjectPath::Repo(ref repo_path) => - format!("{} / {}", repo_path.qual.as_ref(), repo_path.name.as_ref()), - SubjectPath::Crate(ref crate_path) => + SubjectPath::Repo(ref repo_path) => { + format!("{} / {}", repo_path.qual.as_ref(), repo_path.name.as_ref()) + } + SubjectPath::Crate(ref crate_path) => { format!("{} {}", crate_path.name.as_ref(), crate_path.version) + } }; if let Some(outcome) = analysis_outcome { diff --git a/src/server/views/mod.rs b/src/server/views/mod.rs index 387fe62..efbdb0f 100644 --- a/src/server/views/mod.rs +++ b/src/server/views/mod.rs @@ -1,2 +1,2 @@ -pub mod html; pub mod badge; +pub mod html; diff --git a/src/utils/cache.rs b/src/utils/cache.rs index a002159..5018b42 100644 --- a/src/utils/cache.rs +++ b/src/utils/cache.rs @@ -1,30 +1,31 @@ use std::fmt::{Debug, Formatter, Result as FmtResult}; use std::hash::Hash; -use std::time::{Duration, Instant}; use std::ops::Deref; use std::sync::Mutex; +use std::time::{Duration, Instant}; -use failure::Error; -use futures::{Future, Poll}; +use anyhow::{anyhow, ensure, Error}; use futures::future::{FromErr, Shared, SharedItem}; +use futures::{Future, Poll}; use lru_cache::LruCache; -use shared_failure::SharedFailure; use tokio_service::Service; pub struct Cache - where S: Service, - S::Request: Hash + Eq +where + S: Service, + S::Request: Hash + Eq, { inner: S, duration: Duration, - cache: Mutex>)>> + cache: Mutex>)>>, } impl Debug for Cache - where S: Service + Debug, - S::Request: Hash + Eq +where + S: Service + Debug, + S::Request: Hash + Eq, { - fn fmt(&self, fmt: &mut Formatter) -> FmtResult { + fn fmt(&self, fmt: &mut Formatter<'_>) -> FmtResult { fmt.debug_struct("Cache") .field("inner", &self.inner) .field("duration", &self.duration) @@ -32,26 +33,28 @@ impl Debug for Cache } } -impl Cache - where S: Service, - S::Request: Hash + Eq +impl Cache +where + S: Service, + S::Request: Hash + Eq, { pub fn new(service: S, duration: Duration, capacity: usize) -> Cache { Cache { inner: service, duration: duration, - cache: Mutex::new(LruCache::new(capacity)) + cache: Mutex::new(LruCache::new(capacity)), } } } impl Service for Cache - where S: Service, - S::Request: Clone + Hash + Eq +where + S: Service, + S::Request: Clone + Hash + Eq, { type Request = S::Request; type Response = CachedItem; - type Error = SharedFailure; + type Error = Error; type Future = Cached; fn call(&self, req: Self::Request) -> Self::Future { @@ -70,25 +73,27 @@ impl Service for Cache } } -pub struct Cached>(Shared>); +pub struct Cached>(Shared>); impl Debug for Cached - where F: Future + Debug, - F::Item: Debug +where + F: Future + Debug, + F::Item: Debug, { - fn fmt(&self, fmt: &mut Formatter) -> FmtResult { + fn fmt(&self, fmt: &mut Formatter<'_>) -> FmtResult { self.0.fmt(fmt) } } -impl> Future for Cached { +impl> Future for Cached { type Item = CachedItem; - type Error = SharedFailure; + type Error = Error; fn poll(&mut self) -> Poll { - self.0.poll() - .map_err(|err| (*err).clone()) - .map(|async| async.map(CachedItem)) + self.0 + .poll() + .map_err(|_err| anyhow!("TODO: shared error not clone-able")) + .map(|item| item.map(CachedItem)) } }