diff --git a/Cargo.lock b/Cargo.lock index c71e299..b5e37fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,13 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ahash" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ansi_term" version = "0.11.0" @@ -6,6 +16,16 @@ dependencies = [ "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arc-swap" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "array-macro" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "atomicwrites" version = "0.1.5" @@ -22,11 +42,21 @@ name = "atty" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "base64" version = "0.9.1" @@ -51,18 +81,31 @@ name = "byteorder" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "c2-chacha" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cfg-if" -version = "0.1.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" -version = "0.4.2" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -76,22 +119,101 @@ dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "const-random" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const-random-macro" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cursive" -version = "0.5.1" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "enum-map 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "enumset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ncurses 5.99.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "xi-unicode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "darling_core 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "darling_macro 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "darling_core" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ncurses 5.91.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "odds 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", - "owning_ref 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "darling_core 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -100,9 +222,9 @@ version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -165,6 +287,50 @@ name = "encoding_index_tests" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "enum-map" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "array-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "enum-map-derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enum-map-derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enumset" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "enumset_derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enumset_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -180,8 +346,18 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "gcc" -version = "0.3.54" +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -195,12 +371,25 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.0.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.40" +version = "0.2.66" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "maplit" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -209,7 +398,7 @@ version = "0.3.0" dependencies = [ "atomicwrites 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", - "cursive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cursive 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "email 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "vobject 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -217,11 +406,11 @@ dependencies = [ [[package]] name = "ncurses" -version = "5.91.0" +version = "5.99.0" source = "registry+https://github.com/rust-lang/crates.io-index" 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)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -231,99 +420,120 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (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-bigint 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-bigint" -version = "0.1.43" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-complex" -version = "0.1.43" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-integer" -version = "0.1.38" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-iter" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-rational" -version = "0.1.42" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-bigint 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "odds" -version = "0.2.26" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "owning_ref" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "pkg-config" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro-hack" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand" version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" 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)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -333,10 +543,46 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" 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)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_syscall" version = "0.1.37" @@ -359,18 +605,31 @@ dependencies = [ ] [[package]] -name = "rustc-serialize" -version = "0.3.24" +name = "safemem" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "safemem" -version = "0.2.0" +name = "signal-hook" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "serde" -version = "0.9.15" +name = "signal-hook-registry" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -378,6 +637,21 @@ name = "strsim" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tempdir" version = "0.3.7" @@ -387,12 +661,22 @@ dependencies = [ "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "term_size" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -402,7 +686,7 @@ name = "textwrap" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -410,27 +694,24 @@ name = "time" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (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)", ] [[package]] -name = "toml" -version = "0.3.2" +name = "unicode-segmentation" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "unicode-segmentation" -version = "1.2.1" +name = "unicode-width" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "unicode-width" -version = "0.1.4" +name = "unicode-xid" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -461,6 +742,11 @@ name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.2.8" @@ -490,18 +776,37 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "xi-unicode" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [metadata] +"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" +"checksum array-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7d034edd76d4e7adc314c95400941dedc89bd4337d565bf87f6b69d3b20dc4de" "checksum atomicwrites 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7adff0f3666b56fb01ce4caea58193a26d97d384587a10e950e0e9c857de3cca" "checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9263aa6a38da271eec5c91a83ce1e800f093c8535788d403d626d8d5c3f8f007" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" "checksum byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "73b5bdfe7ee3ad0b99c9801d58807a9dbc9e09196365b0203853b99889ab3c87" -"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" -"checksum chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce36c92cb605414e9b824f866f5babe0a0368e39ea07393b9b63cf3844c0e6" +"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" -"checksum cursive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b717f6e01158b6d8bc6cad90badc2adfa8ce8a45594125efb90b854abc98ed93" +"checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" +"checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" +"checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" +"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" +"checksum cursive 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "341b03eec276c30c6cdc640d8bd8c08eac9605064c3f9c4838f958dac06973bb" +"checksum darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +"checksum darling_core 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +"checksum darling_macro 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" "checksum email 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "faacb54ba5ccc18b63f197548756b92e25a3a311696e84044238baf39b90c74a" "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" "checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" @@ -510,47 +815,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" +"checksum enum-map 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "70a375f899a53b9848ad9fb459b5bf90e4851ae5d9fea89134b062dc1828b26e" +"checksum enum-map-derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e57001dfb2532f5a103ff869656887fae9a8defa7d236f3e39d2ee86ed629ad7" +"checksum enumset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "57b811aef4ff1cc938f13bbec348f0ecbfc2bb565b7ab90161c9f0b2805edc8a" +"checksum enumset_derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b184c2d0714bbeeb6440481a19c78530aa210654d99529f13d2f860a1b447598" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "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 gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" -"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b" -"checksum ncurses 5.91.0 (registry+https://github.com/rust-lang/crates.io-index)" = "431cc11a5225e21cb85ea479858ac2e0b3c7a67c9506016cd8818de15dcdc8f1" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +"checksum ncurses 5.99.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15699bee2f37e9f8828c7b35b2bc70d13846db453f2d507713b758fabe536b82" "checksum nix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2c5afeb0198ec7be8569d666644b574345aad2e95a53baf3a532da3e0f3fb32" -"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -"checksum num-bigint 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "81b483ea42927c463e191802e7334556b48e7875297564c0e9951bd3a0ae53e3" -"checksum num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" -"checksum num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac0ea58d64a89d9d6b7688031b3be9358d6c919badcf7fbb0527ccfd891ee45" -"checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" -"checksum num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" -"checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" -"checksum odds 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "4eae0151b9dacf24fcc170d9995e511669a082856a91f958a2fe380bfab3fb22" -"checksum owning_ref 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9d52571ddcb42e9c900c901a18d8d67e393df723fcd51dd59c5b1a85d0acb6cc" +"checksum num 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +"checksum num-complex 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +"checksum num-iter 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00" +"checksum num-rational 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "da4dc79f9e6c81bef96148c8f6b8e72ad4541caa4a24373e900a36da07de03a3" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" "checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f" +"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "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 rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" +"checksum signal-hook 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "7a9c17dd3ba2d36023a5c9472ecddeda07e27fd0b05436e8c1e0c8f178185652" +"checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" +"checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +"checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" -"checksum toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd86ad9ebee246fdedd610e0f6d0587b754a3d81438db930a244d0480ed7878f" -"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1" -"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" +"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc7e3b898aa6f6c08e5295b6c89258d1331e9ac578cc992fb818759951bdc22" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d" "checksum vobject 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d8c8e593ed666f591f3313cb4ac158d5135ccd825e71ca8b2afe5a16c601eed8" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "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 xi-unicode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7395cdb9d0a6219fa0ea77d08c946adf9c1984c72fcd443ace30365f3daadef7" diff --git a/Cargo.toml b/Cargo.toml index aa36ff5..f13593e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,8 @@ documentation = "https://github.com/untitaker/mates.rs" homepage = "https://github.com/untitaker/mates.rs" repository = "https://github.com/untitaker/mates.rs" +edition = "2018" + [lib] name = "mates" path = "src/mates/lib.rs" @@ -26,7 +28,7 @@ atomicwrites = "0.1" email = "0.0" clap = "2.31" vobject = "0.2" -cursive = "0.5" +cursive = "0.14" [build-dependencies] clap = "2.31" diff --git a/src/bin/mates.rs b/src/bin/mates.rs index e34f9f5..651d38a 100644 --- a/src/bin/mates.rs +++ b/src/bin/mates.rs @@ -1,4 +1,6 @@ extern crate mates; use mates::cli; -fn main() { cli::cli_main() } +fn main() { + cli::cli_main() +} diff --git a/src/mates/app.rs b/src/mates/app.rs index 36b79fe..1be1a7c 100644 --- a/src/mates/app.rs +++ b/src/mates/app.rs @@ -1,4 +1,4 @@ -use clap::{App, Arg, AppSettings, SubCommand}; +use clap::{App, AppSettings, Arg, SubCommand}; pub fn app() -> App<'static, 'static> { App::new("mates") @@ -6,20 +6,29 @@ pub fn app() -> App<'static, 'static> { .author("Markus Unterwaditzer") .about("A simple commandline addressbook") .setting(AppSettings::SubcommandRequired) - .subcommand(SubCommand::with_name("index") - .about("Rewrite/create the index")) - .subcommand(SubCommand::with_name("mutt-query") - .about("Search for contact, output is usable for mutt's query_command.") - .arg(Arg::with_name("query").index(1))) - .subcommand(SubCommand::with_name("file-query") - .about("Search for contact, return just the filename.") - .arg(Arg::with_name("query").index(1))) - .subcommand(SubCommand::with_name("email-query") - .about("Search for contact, return \"name \".") - .arg(Arg::with_name("query").index(1))) - .subcommand(SubCommand::with_name("add") - .about("Take mail from stdin, add sender to contacts. Print filename.")) - .subcommand(SubCommand::with_name("edit") - .about("Open contact (given by filepath or search-string) interactively.") - .arg(Arg::with_name("file-or-query").index(1))) + .subcommand(SubCommand::with_name("index").about("Rewrite/create the index")) + .subcommand( + SubCommand::with_name("mutt-query") + .about("Search for contact, output is usable for mutt's query_command.") + .arg(Arg::with_name("query").index(1)), + ) + .subcommand( + SubCommand::with_name("file-query") + .about("Search for contact, return just the filename.") + .arg(Arg::with_name("query").index(1)), + ) + .subcommand( + SubCommand::with_name("email-query") + .about("Search for contact, return \"name \".") + .arg(Arg::with_name("query").index(1)), + ) + .subcommand( + SubCommand::with_name("add") + .about("Take mail from stdin, add sender to contacts. Print filename."), + ) + .subcommand( + SubCommand::with_name("edit") + .about("Open contact (given by filepath or search-string) interactively.") + .arg(Arg::with_name("file-or-query").index(1)), + ) } diff --git a/src/mates/cli.rs b/src/mates/cli.rs index b96f84c..1dc8dae 100644 --- a/src/mates/cli.rs +++ b/src/mates/cli.rs @@ -1,19 +1,19 @@ use std::borrow::ToOwned; use std::env; use std::error::Error; -use std::fmt;use std::fs; -use std::io::{Read,Write}; +use std::fmt; +use std::fs; use std::io; +use std::io::{Read, Write}; use std::path; use std::process; -use atomicwrites::{AtomicFile,AllowOverwrite}; - -use utils; -use utils::CustomPathExt; -use app; -use editor; +use atomicwrites::{AllowOverwrite, AtomicFile}; +use crate::app; +use crate::editor; +use crate::utils; +use crate::utils::CustomPathExt; #[inline] fn get_pwd() -> path::PathBuf { @@ -37,8 +37,8 @@ fn build_index(outfile: &path::Path, dir: &path::Path) -> MainResult<()> { let af = AtomicFile::new(&outfile, AllowOverwrite); let mut errors = false; - try!(af.write::<(), io::Error, _>(|outf| { - for entry in try!(fs::read_dir(dir)) { + af.write::<(), io::Error, _>(|outf| { + for entry in fs::read_dir(dir)? { let entry = match entry { Ok(x) => x, Err(e) => { @@ -59,23 +59,23 @@ fn build_index(outfile: &path::Path, dir: &path::Path) -> MainResult<()> { Err(e) => { println!("Error while reading {}: {}", pathbuf.display(), e); errors = true; - continue + continue; } }; match utils::index_item_from_contact(&contact) { Ok(index_string) => { - try!(outf.write_all(index_string.as_bytes())); - }, + outf.write_all(index_string.as_bytes())?; + } Err(e) => { println!("Error while indexing {}: {}", pathbuf.display(), e); errors = true; - continue + continue; } }; - }; + } Ok(()) - })); + })?; if errors { Err(MainError::new("Several errors happened while generating the index.").into()) @@ -89,8 +89,8 @@ pub fn cli_main() { Err(e) => { writeln!(&mut io::stderr(), "{}", e).unwrap(); process::exit(1); - }, - _ => () + } + _ => (), }; } @@ -106,47 +106,49 @@ pub fn cli_main_raw() -> MainResult<()> { } }; - let submatches = matches.subcommand_matches(command).expect("Internal error."); + let submatches = matches + .subcommand_matches(command) + .expect("Internal error."); match command { "index" => { - println!("Rebuilding index file \"{}\"...", config.index_path.display()); - try!(build_index(&config.index_path, &config.vdir_path)); - }, + println!( + "Rebuilding index file \"{}\"...", + config.index_path.display() + ); + build_index(&config.index_path, &config.vdir_path)?; + } "mutt-query" => { let query = submatches.value_of("query").unwrap_or(""); - try!(mutt_query(&config, &query[..])); - }, + mutt_query(&config, &query[..])?; + } "file-query" => { let query = submatches.value_of("query").unwrap_or(""); - try!(file_query(&config, &query[..])); - }, + file_query(&config, &query[..])?; + } "email-query" => { let query = submatches.value_of("query").unwrap_or(""); - try!(email_query(&config, &query[..])); - }, + email_query(&config, &query[..])?; + } "add" => { let stdin = io::stdin(); let mut email = String::new(); - try!(stdin.lock().read_to_string(&mut email)); - let contact = try!(utils::add_contact_from_email( - &config.vdir_path, - &email[..] - )); + stdin.lock().read_to_string(&mut email)?; + let contact = utils::add_contact_from_email(&config.vdir_path, &email[..])?; println!("{}", contact.path.display()); - let mut index_fp = try!(fs::OpenOptions::new() - .append(true) - .write(true) - .open(&config.index_path)); + let mut index_fp = fs::OpenOptions::new() + .append(true) + .write(true) + .open(&config.index_path)?; - let index_entry = try!(utils::index_item_from_contact(&contact)); - try!(index_fp.write_all(index_entry.as_bytes())); - }, + let index_entry = utils::index_item_from_contact(&contact)?; + index_fp.write_all(index_entry.as_bytes())?; + } "edit" => { let query = submatches.value_of("file-or-query").unwrap_or(""); - try!(edit_contact(&config, &query[..])); - }, + edit_contact(&config, &query[..])?; + } _ => { return Err(MainError::new(format!("Invalid command: {}", command)).into()); } @@ -158,7 +160,7 @@ fn edit_contact(config: &Configuration, query: &str) -> MainResult<()> { let results = if get_pwd().join(query).is_file() { vec![path::PathBuf::from(query)] } else { - try!(utils::file_query(config, query)).into_iter().collect() + utils::file_query(config, query)?.into_iter().collect() }; if results.len() < 1 { @@ -172,13 +174,13 @@ fn edit_contact(config: &Configuration, query: &str) -> MainResult<()> { let fcontent = { let mut fcontent = String::new(); - let mut file = try!(fs::File::open(fpath)); - try!(file.read_to_string(&mut fcontent)); + let mut file = fs::File::open(fpath)?; + file.read_to_string(&mut fcontent)?; fcontent }; if (&fcontent[..]).trim().len() == 0 { - try!(fs::remove_file(fpath)); + fs::remove_file(fpath)?; return Err(MainError::new("Contact emptied, file removed.").into()); }; @@ -186,38 +188,38 @@ fn edit_contact(config: &Configuration, query: &str) -> MainResult<()> { } fn mutt_query<'a>(config: &Configuration, query: &str) -> MainResult<()> { - println!(""); // For some reason mutt requires an empty line - // We need to ignore errors here, otherwise mutt's UI will glitch + println!(""); // For some reason mutt requires an empty line + // We need to ignore errors here, otherwise mutt's UI will glitch if let Ok(items) = utils::index_query(config, query) { for item in items { if item.email.len() > 0 && item.name.len() > 0 { println!("{}\t{}", item.email, item.name); }; - }; + } }; Ok(()) } fn file_query<'a>(config: &Configuration, query: &str) -> MainResult<()> { - for path in try!(utils::file_query(config, query)).iter() { + for path in utils::file_query(config, query)?.iter() { println!("{}", path.display()); - }; + } Ok(()) } fn email_query<'a>(config: &Configuration, query: &str) -> MainResult<()> { - for item in try!(utils::index_query(config, query)) { + for item in utils::index_query(config, query)? { if item.name.len() > 0 && item.email.len() > 0 { println!("{} <{}>", item.name, item.email); }; - }; + } Ok(()) } pub struct Configuration { pub index_path: path::PathBuf, pub vdir_path: path::PathBuf, - pub grep_cmd: String + pub grep_cmd: String, } impl Configuration { @@ -227,49 +229,51 @@ impl Configuration { Some(x) => path::PathBuf::from(&x), None => match get_envvar("HOME") { Some(home) => get_pwd().join(&home).join(".mates_index"), - None => return Err("Unable to determine user's home directory.".to_owned()) - } + None => return Err("Unable to determine user's home directory.".to_owned()), + }, }, vdir_path: match get_envvar("MATES_DIR") { Some(x) => path::PathBuf::from(&x), - None => return Err("MATES_DIR must be set to your vdir path (directory of vcf-files).".to_owned()) + None => { + return Err( + "MATES_DIR must be set to your vdir path (directory of vcf-files)." + .to_owned(), + ) + } }, grep_cmd: match get_envvar("MATES_GREP") { Some(x) => x, - None => "grep -i".to_owned() - } + None => "grep -i".to_owned(), + }, }) } } - #[derive(PartialEq, Eq, Debug)] pub struct MainError { desc: String, } -pub type MainResult = Result>; +pub type MainResult = Result>; impl Error for MainError { fn description(&self) -> &str { &self.desc[..] } - fn cause(&self) -> Option<&Error> { + fn cause(&self) -> Option<&dyn Error> { None } } impl fmt::Display for MainError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.description().fmt(f) + self.desc.fmt(f) } } impl MainError { pub fn new>(desc: T) -> Self { - MainError { - desc: desc.into(), - } + MainError { desc: desc.into() } } } diff --git a/src/mates/editor/mod.rs b/src/mates/editor/mod.rs index 6b37793..9818087 100644 --- a/src/mates/editor/mod.rs +++ b/src/mates/editor/mod.rs @@ -1,16 +1,17 @@ use std::fs; -use std::io::{Read,Write}; -use std::process; +use std::io::{Read, Write}; use std::path::Path; +use std::process; use vobject; use atomicwrites; -use cursive::Cursive; use cursive::theme; -use cursive::theme::Color::*; use cursive::theme::BaseColor::*; +use cursive::theme::Color::*; +use cursive::Cursive; +use cursive::With; mod widgets; @@ -29,33 +30,33 @@ pub fn cli_main>(filename: P) { process::exit(1); } - let (editor, editor_view) = VcardEditor::new(vobj); - let mut siv = Cursive::new(); + let mut siv = Cursive::default(); siv.add_fullscreen_layer(editor_view); siv.set_theme(theme::Theme { shadow: false, - borders: Some(theme::BorderStyle::Simple), - colors: theme::Palette { - background: Dark(Black), - shadow: Dark(Black), - view: Dark(Black), - primary: Dark(White), - secondary: Dark(White), - tertiary: Dark(White), - title_primary: Dark(White), - title_secondary: Dark(White), - highlight: Light(White), - highlight_inactive: Dark(Black), - } + borders: theme::BorderStyle::Simple, + palette: theme::Palette::default().with(|p| { + p.set_color("background", Dark(Black)); + p.set_color("shadow", Dark(Black)); + p.set_color("view", Dark(Black)); + p.set_color("primary", Dark(White)); + p.set_color("secondary", Dark(White)); + p.set_color("tertiary", Dark(White)); + p.set_color("title_primary", Dark(White)); + p.set_color("title_secondary", Dark(White)); + p.set_color("highlight", Light(White)); + p.set_color("highlight_inactive", Dark(Black)); + }), }); siv.run(); vobj = editor.to_vobject(&mut siv); - drop(siv); // Necessary to be able to write text immediately afterwards + drop(siv); // Necessary to be able to write text immediately afterwards let af = atomicwrites::AtomicFile::new(filename, atomicwrites::AllowOverwrite); - af.write(|mut f| f.write_all(vobject::write_component(&vobj).as_bytes())).unwrap(); + af.write(|f| f.write_all(vobject::write_component(&vobj).as_bytes())) + .unwrap(); } diff --git a/src/mates/editor/widgets.rs b/src/mates/editor/widgets.rs index 24b405b..4de155e 100644 --- a/src/mates/editor/widgets.rs +++ b/src/mates/editor/widgets.rs @@ -1,43 +1,48 @@ use std::ops::Deref; -use cursive::Cursive; use cursive::traits::*; use cursive::views; +use cursive::Cursive; use vobject; struct FormattedNameEditor { - original_prop: Option + original_prop: Option, } impl FormattedNameEditor { - pub fn pop_from_vobject(vobj: &mut vobject::Component) -> (Self, views::IdView) { + pub fn pop_from_vobject( + vobj: &mut vobject::Component, + ) -> (Self, views::NamedView) { let prop = vobj.pop("FN"); let content = match prop { Some(ref p) => p.value_as_string(), - None => "".to_owned() + None => "".to_owned(), }; - (FormattedNameEditor { original_prop: prop }, - views::EditView::new().content(content).with_id("FN")) + ( + FormattedNameEditor { + original_prop: prop, + }, + views::EditView::new().content(content).with_name("FN"), + ) } pub fn push_to_vobject(&self, siv: &mut Cursive, vobj: &mut vobject::Component) { - let v = siv.find_id::("FN").unwrap(); + let v = siv.find_name::("FN").unwrap(); let content = v.get_content(); let new_prop = match self.original_prop { Some(ref x) => { let mut nx = x.clone(); nx.raw_value = vobject::escape_chars(content.as_str()); nx - }, - None => vobject::Property::new("FN", content.as_str()) + } + None => vobject::Property::new("FN", content.as_str()), }; vobj.push(new_prop); } } - fn mprops_to_view(props: Vec) -> views::TextArea { let mut edit_text = String::new(); for prop in props { @@ -52,7 +57,11 @@ fn mprops_to_view(props: Vec) -> views::TextArea { views::TextArea::new().content(edit_text) } -fn view_to_mprops>(v: V, prop_name: &str, vobj: &mut vobject::Component) { +fn view_to_mprops>( + v: V, + prop_name: &str, + vobj: &mut vobject::Component, +) { for line in v.get_content().split('\n') { let mut split = line.rsplitn(2, ' '); let mut prop = match split.next() { @@ -69,13 +78,15 @@ fn view_to_mprops>(v: V, prop_name: &str, vobj: struct EmailsEditor; impl EmailsEditor { - pub fn pop_from_vobject(vobj: &mut vobject::Component) -> (Self, views::IdView) { + pub fn pop_from_vobject( + vobj: &mut vobject::Component, + ) -> (Self, views::NamedView) { let props = vobj.props.remove("EMAIL").unwrap_or_else(Vec::new); - (EmailsEditor, mprops_to_view(props).with_id("emails")) + (EmailsEditor, mprops_to_view(props).with_name("emails")) } pub fn push_to_vobject(&self, siv: &mut Cursive, vobj: &mut vobject::Component) { - let v = siv.find_id::("emails").unwrap(); + let v = siv.find_name::("emails").unwrap(); view_to_mprops(v, "EMAIL", vobj); } } @@ -83,13 +94,15 @@ impl EmailsEditor { struct TelEditor; impl TelEditor { - pub fn pop_from_vobject(vobj: &mut vobject::Component) -> (Self, views::IdView) { + pub fn pop_from_vobject( + vobj: &mut vobject::Component, + ) -> (Self, views::NamedView) { let props = vobj.props.remove("TEL").unwrap_or_else(Vec::new); - (TelEditor, mprops_to_view(props).with_id("tels")) + (TelEditor, mprops_to_view(props).with_name("tels")) } pub fn push_to_vobject(&self, siv: &mut Cursive, vobj: &mut vobject::Component) { - let v = siv.find_id::("tels").unwrap(); + let v = siv.find_name::("tels").unwrap(); view_to_mprops(v, "TEL", vobj); } } @@ -98,30 +111,38 @@ pub struct VcardEditor { vobj: vobject::Component, fn_field: FormattedNameEditor, email_field: EmailsEditor, - tel_field: TelEditor + tel_field: TelEditor, } impl VcardEditor { - pub fn new(mut vobj: vobject::Component) -> (Self, views::BoxView) { + pub fn new(mut vobj: vobject::Component) -> (Self, views::ResizedView) { let (fn_field, fn_view) = FormattedNameEditor::pop_from_vobject(&mut vobj); let (email_field, email_view) = EmailsEditor::pop_from_vobject(&mut vobj); let (tel_field, tel_view) = TelEditor::pop_from_vobject(&mut vobj); let main_col = views::LinearLayout::vertical() - .child(views::Panel::new(views::LinearLayout::vertical() - .child(views::TextView::new("Formatted Name:")) - .child(fn_view))) - .child(views::Panel::new(views::LinearLayout::vertical() - .child(views::TextView::new("Hit ^C to abort, or ")) - .child(views::Button::new("Save", |s| s.quit())))); + .child(views::Panel::new( + views::LinearLayout::vertical() + .child(views::TextView::new("Formatted Name:")) + .child(fn_view), + )) + .child(views::Panel::new( + views::LinearLayout::vertical() + .child(views::TextView::new("Hit ^C to abort, or ")) + .child(views::Button::new("Save", |s| s.quit())), + )); let props_list = views::LinearLayout::vertical() - .child(views::Panel::new(views::LinearLayout::vertical() - .child(views::TextView::new("Email addresses: (type + email)")) - .child(email_view))) - .child(views::Panel::new(views::LinearLayout::vertical() - .child(views::TextView::new("Telephone numbers: (type + nr)")) - .child(tel_view))); + .child(views::Panel::new( + views::LinearLayout::vertical() + .child(views::TextView::new("Email addresses: (type + email)")) + .child(email_view), + )) + .child(views::Panel::new( + views::LinearLayout::vertical() + .child(views::TextView::new("Telephone numbers: (type + nr)")) + .child(tel_view), + )); let cols = views::LinearLayout::horizontal() .child(main_col) @@ -132,7 +153,7 @@ impl VcardEditor { vobj: vobj, fn_field: fn_field, email_field: email_field, - tel_field: tel_field + tel_field: tel_field, }; (rv, cols) diff --git a/src/mates/lib.rs b/src/mates/lib.rs index 7f52dd7..2dd98e0 100644 --- a/src/mates/lib.rs +++ b/src/mates/lib.rs @@ -1,11 +1,11 @@ -extern crate vobject; -extern crate email; -extern crate uuid; extern crate atomicwrites; extern crate clap; extern crate cursive; +extern crate email; +extern crate uuid; +extern crate vobject; pub mod app; pub mod cli; -mod utils; mod editor; +mod utils; diff --git a/src/mates/utils.rs b/src/mates/utils.rs index 4fb54c8..86bfd11 100644 --- a/src/mates/utils.rs +++ b/src/mates/utils.rs @@ -1,18 +1,18 @@ use std::borrow::ToOwned; use std::collections::HashSet; +use std::convert::AsRef; use std::fs; -use std::io::{Read,Write}; use std::io; +use std::io::{Read, Write}; use std::path; use std::process; -use std::convert::AsRef; -use atomicwrites::{AtomicFile,DisallowOverwrite}; +use atomicwrites::{AtomicFile, DisallowOverwrite}; use email::rfc5322::Rfc5322Parser; use uuid::Uuid; -use vobject::{Component,Property,parse_component,write_component}; +use vobject::{parse_component, write_component, Component, Property}; -use cli::Configuration; +use crate::cli::Configuration; pub trait CustomPathExt { fn metadata(&self) -> io::Result; @@ -23,9 +23,13 @@ pub trait CustomPathExt { } impl CustomPathExt for path::Path { - fn metadata(&self) -> io::Result { fs::metadata(self) } + fn metadata(&self) -> io::Result { + fs::metadata(self) + } - fn exists(&self) -> bool { fs::metadata(self).is_ok() } + fn exists(&self) -> bool { + fs::metadata(self).is_ok() + } fn is_file(&self) -> bool { fs::metadata(self).map(|s| s.is_file()).unwrap_or(false) @@ -40,27 +44,24 @@ impl CustomPathExt for path::Path { } pub fn handle_process(process: &mut process::Child) -> io::Result<()> { - let exitcode = try!(process.wait()); + let exitcode = process.wait()?; if !exitcode.success() { return Err(io::Error::new( io::ErrorKind::Other, - format!("{}", exitcode) + format!("{}", exitcode), )); }; Ok(()) } - pub struct IndexIterator { - linebuffer: Vec + linebuffer: Vec, } impl IndexIterator { fn new(output: &String) -> IndexIterator { let rv = output.split('\n').map(|x| x.to_string()).collect(); - IndexIterator { - linebuffer: rv - } + IndexIterator { linebuffer: rv } } } @@ -70,7 +71,7 @@ impl Iterator for IndexIterator { fn next(&mut self) -> Option { match self.linebuffer.pop() { Some(x) => Some(IndexItem::new(x)), - None => None + None => None, } } } @@ -78,7 +79,7 @@ impl Iterator for IndexIterator { pub struct IndexItem { pub email: String, pub name: String, - pub filepath: Option + pub filepath: Option, } impl IndexItem { @@ -90,35 +91,40 @@ impl IndexItem { name: parts.next().unwrap_or("").to_string(), filepath: match parts.next() { Some(x) => Some(path::PathBuf::from(x)), - None => None - } + None => None, + }, } } } pub struct Contact { pub component: Component, - pub path: path::PathBuf + pub path: path::PathBuf, } impl Contact { pub fn from_file>(path: P) -> io::Result { - let mut contact_file = try!(fs::File::open(&path)); + let mut contact_file = fs::File::open(&path)?; let contact_string = { let mut x = String::new(); - try!(contact_file.read_to_string(&mut x)); + contact_file.read_to_string(&mut x)?; x }; let item = match parse_component(&contact_string[..]) { Ok(x) => x, - Err(e) => return Err(io::Error::new( - io::ErrorKind::Other, - format!("Error while parsing contact: {}", e) - )) + Err(e) => { + return Err(io::Error::new( + io::ErrorKind::Other, + format!("Error while parsing contact: {}", e), + )) + } }; - Ok(Contact { component: item, path: path.as_ref().to_owned() }) + Ok(Contact { + component: item, + path: path.as_ref().to_owned(), + }) } pub fn generate(fullname: Option<&str>, email: Option<&str>, dir: &path::Path) -> Contact { @@ -129,26 +135,26 @@ impl Contact { uid = Uuid::new_v4().hyphenated().to_string(); contact_path = dir.join(&format!("{}.vcf", uid)); if !(*contact_path).exists() { - break + break; } - }; + } (uid, contact_path) }; - Contact { path: contact_path, component: generate_component(uid.into(), fullname, email) } + Contact { + path: contact_path, + component: generate_component(uid.into(), fullname, email), + } } pub fn write_create(&self) -> io::Result<()> { let string = write_component(&self.component); let af = AtomicFile::new(&self.path, DisallowOverwrite); - try!(af.write(|f| { - f.write_all(string.as_bytes()) - })); + af.write(|f| f.write_all(string.as_bytes()))?; Ok(()) } } - fn generate_component(uid: String, fullname: Option<&str>, email: Option<&str>) -> Component { let mut comp = Component::new("VCARD"); @@ -156,39 +162,40 @@ fn generate_component(uid: String, fullname: Option<&str>, email: Option<&str>) match fullname { Some(x) => comp.push(Property::new("FN", x)), - None => () + None => (), }; match email { Some(x) => comp.push(Property::new("EMAIL", x)), - None => () + None => (), }; comp.push(Property::new("UID", &uid[..])); comp } pub fn index_query<'a>(config: &Configuration, query: &str) -> io::Result { - let mut process = try!( - command_from_config(&config.grep_cmd[..]) + let mut process = command_from_config(&config.grep_cmd[..]) .arg(&query[..]) .arg(&config.index_path) .stdin(process::Stdio::piped()) .stdout(process::Stdio::piped()) .stderr(process::Stdio::inherit()) - .spawn()); + .spawn()?; - try!(handle_process(&mut process)); + handle_process(&mut process)?; let stream = match process.stdout.as_mut() { Some(x) => x, - None => return Err(io::Error::new( - io::ErrorKind::Other, - "Failed to get stdout from grep process.", - )) + None => { + return Err(io::Error::new( + io::ErrorKind::Other, + "Failed to get stdout from grep process.", + )) + } }; let mut output = String::new(); - try!(stream.read_to_string(&mut output)); + stream.read_to_string(&mut output)?; Ok(IndexIterator::new(&output)) } @@ -196,26 +203,28 @@ pub fn index_query<'a>(config: &Configuration, query: &str) -> io::Result io::Result> { let mut rv: HashSet = HashSet::new(); - rv.extend( - try!(index_query(config, query)).filter_map(|x| x.filepath) - ); + rv.extend(index_query(config, query)?.filter_map(|x| x.filepath)); Ok(rv) } pub fn index_item_from_contact(contact: &Contact) -> io::Result { let name = match contact.component.get_only("FN") { Some(name) => name.value_as_string(), - None => return Err(io::Error::new( - io::ErrorKind::Other, - "No name found.", - )) + None => return Err(io::Error::new(io::ErrorKind::Other, "No name found.")), }; let emails = contact.component.get_all("EMAIL"); let mut rv = String::new(); for email in emails.iter() { - rv.push_str(&format!("{}\t{}\t{}\n", email.value_as_string(), name, contact.path.display())[..]); - }; + rv.push_str( + &format!( + "{}\t{}\t{}\n", + email.value_as_string(), + name, + contact.path.display() + )[..], + ); + } Ok(rv) } @@ -223,8 +232,8 @@ pub fn index_item_from_contact(contact: &Contact) -> io::Result { pub fn parse_from_header<'a>(s: &'a String) -> (Option<&'a str>, Option<&'a str>) { let mut split = s.rsplitn(2, '<'); let email = match split.next() { - Some(x) => Some(x.trim_right_matches('>')), - None => Some(&s[..]) + Some(x) => Some(x.trim_end_matches('>')), + None => Some(&s[..]), }; let name = split.next(); (name, email) @@ -237,12 +246,12 @@ pub fn read_sender_from_email(email: &str) -> Option { match parser.consume_header() { Some(header) => { if header.name == "From" { - return header.get_value().ok() + return header.get_value().ok(); }; - }, - None => return None + } + None => return None, }; - }; + } None } @@ -250,18 +259,19 @@ pub fn read_sender_from_email(email: &str) -> Option { pub fn add_contact_from_email(contact_dir: &path::Path, email_input: &str) -> io::Result { let from_header = match read_sender_from_email(email_input) { Some(x) => x, - None => return Err(io::Error::new( - io::ErrorKind::InvalidInput, - "Couldn't find From-header in email.", - )) + None => { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "Couldn't find From-header in email.", + )) + } }; let (fullname, email) = parse_from_header(&from_header); let contact = Contact::generate(fullname, email, contact_dir); - try!(contact.write_create()); + contact.write_create()?; Ok(contact) } - fn command_from_config(config_val: &str) -> process::Command { let mut parts = config_val.split(' '); let main = parts.next().unwrap();