diff --git a/Cargo.lock b/Cargo.lock index 9c28714..014a5dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,10 +2,10 @@ # It is not intended for manual editing. [[package]] name = "aho-corasick" -version = "0.6.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -13,48 +13,54 @@ name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "assert_matches" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "atty" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "autocfg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "backtrace" -version = "0.3.8" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.23 (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.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" -version = "0.1.23" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -68,24 +74,24 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.17" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.3" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clap" -version = "2.31.2" +version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "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)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -96,7 +102,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -104,31 +110,31 @@ name = "dotenv" version = "0.13.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)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "edit-distance" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "either" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "env_logger" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -138,36 +144,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "failure" -version = "0.1.1" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" version = "0.1.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)", - "synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.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)", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "glob" @@ -176,7 +174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "humantime" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -184,10 +182,10 @@ dependencies = [ [[package]] name = "itertools" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -195,20 +193,20 @@ name = "just" version = "0.3.13" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "brev 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.12 (registry+https://github.com/rust-lang/crates.io-index)", + "edit-distance 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "executable-path 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "target 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -216,42 +214,47 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.42" +version = "0.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "log" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memchr" -version = "2.0.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "nix" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.17 (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.42 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "proc-macro2" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quick-error" version = "1.2.2" @@ -259,22 +262,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quote" -version = "0.3.15" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "rand" -version = "0.4.2" +version = "0.4.6" 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.42 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" -version = "0.1.40" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -282,27 +311,27 @@ name = "redox_termios" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "1.0.0" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.1" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -310,44 +339,38 @@ name = "remove_dir_all" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-demangle" -version = "0.1.8" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "strsim" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.11.11" +version = "0.15.30" source = "registry+https://github.com/rust-lang/crates.io-index" 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 = "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)", + "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (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 = "synstructure" -version = "0.6.1" +version = "0.10.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 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -360,16 +383,16 @@ name = "tempdir" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "termcolor" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wincolor 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -377,14 +400,14 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "textwrap" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -392,16 +415,15 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ucd-util" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -411,20 +433,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-xid" -version = "0.0.4" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "utf8-ranges" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -439,7 +453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -451,6 +465,14 @@ name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winapi-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -458,69 +480,73 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wincolor" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] -"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" +"checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "664470abf00fae0f31c0eb6e1ca12d82961b2a2541ef898bc9dd51a9254d218b" -"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" -"checksum backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbdd17cd962b570302f5297aea8648d5923e22e555c2ed2d8b2e34eca646bf6d" -"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" -"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" +"checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" +"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" +"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" +"checksum backtrace 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "f106c02a3604afcdc0df5d36cc47b44b55917dbaf3d808f71c163a0ddba64637" +"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" +"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum brev 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "423c06240bda0044486c500264dd450b24eb25d1223103a6b8b817ed7fc0be7a" -"checksum cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "49ec142f5768efb5b7622aebc3fdbdbb8950a4b9ba996393cb76ef7466e8747d" -"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" -"checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" +"checksum cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5e5f3fee5eeb60324c2781f1e41286bdee933850fff9b3c672587fed5ec58c83" +"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "630391922b1b893692c6334369ff528dcc3a9d8061ccf4c803aa8f83cb13db5e" "checksum dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d0a1279c96732bc6800ce6337b6a614697b0e74ae058dc03c62ebeb78b4d86" -"checksum edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3bd26878c3d921f89797a4e1a1711919f999a9f6946bb6f5a4ffda126d297b7e" -"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" -"checksum env_logger 0.5.12 (registry+https://github.com/rust-lang/crates.io-index)" = "f4d7e69c283751083d53d01eac767407343b8b69c4bd70058e08adc2637cb257" +"checksum edit-distance 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bbbaaaf38131deb9ca518a274a45bfdb8771f139517b073b16c2d3d32ae5037b" +"checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" +"checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" "checksum executable-path 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ebc5a6d89e3c90b84e8f33c8737933dda8f1c106b5415900b38b9d433841478" -"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 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 failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" +"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" -"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" -"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" -"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739" -"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1" -"checksum log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cba860f648db8e6f269df990180c2217f333472b4a6e901e97446858487971e2" -"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" +"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" +"checksum itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)" = "bedcc7a809076656486ffe045abeeac163da1b558e963a31e29fbfbeba916917" +"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" +"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17" +"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" -"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" +"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3" -"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54" +"checksum regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "559008764a17de49a3146b234641644ed37d118d1ef641a0bb573d146edc6ce0" +"checksum regex-syntax 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649" -"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"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 rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +"checksum syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)" = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2" +"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum target 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "10000465bb0cc031c87a44668991b284fd84c0e6bd945f62d4af04e9e52a222a" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum termcolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "722426c4a0539da2c4ffd9b419d90ad540b4cff4a053be9069c908d4d07e2836" +"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "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 thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" -"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9dc3aa9dcda98b5a16150c54619c1ead22e3d3a5d458778ae914be760aa981a" +"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" diff --git a/Cargo.toml b/Cargo.toml index f316993..8032905 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ authors = ["Casey Rodarmor "] license = "CC0-1.0" homepage = "https://github.com/casey/just" readme = "crates-io-readme.md" +edition = "2018" [dependencies] ansi_term = "0.11" diff --git a/clippy.toml b/clippy.toml index 5616f26..c65f45a 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,3 +1,3 @@ -cognitive-complexity-threshold = 1337 +cyclomatic-complexity-threshold = 1337 doc-valid-idents = ["FreeBSD"] diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 6129b74..13d04c8 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "aho-corasick" version = "0.6.8" @@ -191,7 +193,7 @@ dependencies = [ [[package]] name = "just" -version = "0.3.12" +version = "0.3.13" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -216,7 +218,7 @@ dependencies = [ name = "just-fuzz" version = "0.0.0" dependencies = [ - "just 0.3.12", + "just 0.3.13", "libfuzzer-sys 0.1.0 (git+https://github.com/rust-fuzz/libfuzzer-sys.git)", ] diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 205a1cf..11bca1a 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -3,6 +3,7 @@ name = "just-fuzz" version = "0.0.0" authors = ["Automatically generated"] publish = false +edition = "2018" [package.metadata] cargo-fuzz = true diff --git a/fuzz/src/bin/fuzz-compiler.rs b/fuzz/src/bin/fuzz-compiler.rs index 3d3d51b..180f365 100644 --- a/fuzz/src/bin/fuzz-compiler.rs +++ b/fuzz/src/bin/fuzz-compiler.rs @@ -1,8 +1,6 @@ #![no_main] -#[macro_use] -extern crate libfuzzer_sys; -extern crate just; +use libfuzzer_sys::fuzz_target; fuzz_target!(|data: &[u8]| { std::str::from_utf8(data).map(just::fuzzing::compile).ok(); diff --git a/justfile b/justfile index 8d5d909..1200a6b 100755 --- a/justfile +++ b/justfile @@ -6,7 +6,7 @@ bt='0' export RUST_BACKTRACE=bt -test: build +test: cargo test fuzz: @@ -20,7 +20,7 @@ fuzz: } | less # only run tests matching PATTERN -filter PATTERN: build +filter PATTERN: cargo test {{PATTERN}} # test with backtrace @@ -70,7 +70,7 @@ install-dev-deps: # everyone's favorite animate paper clip clippy: - cargo +nightly clippy + cargo clippy # count non-empty lines of code sloc: diff --git a/src/alias.rs b/src/alias.rs index 35ba6c6..c33c202 100644 --- a/src/alias.rs +++ b/src/alias.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; pub struct Alias<'a> { pub name: &'a str, @@ -7,7 +7,7 @@ pub struct Alias<'a> { } impl<'a> Display for Alias<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "alias {} = {}", self.name, self.target) } } diff --git a/src/alias_resolver.rs b/src/alias_resolver.rs index bc71136..e8c85f9 100644 --- a/src/alias_resolver.rs +++ b/src/alias_resolver.rs @@ -1,20 +1,20 @@ -use common::*; +use crate::common::*; use CompilationErrorKind::*; pub struct AliasResolver<'a, 'b> where 'a: 'b, { - aliases: &'b Map<&'a str, Alias<'a>>, - recipes: &'b Map<&'a str, Recipe<'a>>, - alias_tokens: &'b Map<&'a str, Token<'a>>, + aliases: &'b BTreeMap<&'a str, Alias<'a>>, + recipes: &'b BTreeMap<&'a str, Recipe<'a>>, + alias_tokens: &'b BTreeMap<&'a str, Token<'a>>, } impl<'a: 'b, 'b> AliasResolver<'a, 'b> { pub fn resolve_aliases( - aliases: &Map<&'a str, Alias<'a>>, - recipes: &Map<&'a str, Recipe<'a>>, - alias_tokens: &Map<&'a str, Token<'a>>, + aliases: &BTreeMap<&'a str, Alias<'a>>, + recipes: &BTreeMap<&'a str, Recipe<'a>>, + alias_tokens: &BTreeMap<&'a str, Token<'a>>, ) -> CompilationResult<'a, ()> { let resolver = AliasResolver { aliases, diff --git a/src/assignment_evaluator.rs b/src/assignment_evaluator.rs index 657062d..2d1391f 100644 --- a/src/assignment_evaluator.rs +++ b/src/assignment_evaluator.rs @@ -1,30 +1,30 @@ -use common::*; +use crate::common::*; use brev; pub struct AssignmentEvaluator<'a: 'b, 'b> { - pub assignments: &'b Map<&'a str, Expression<'a>>, + pub assignments: &'b BTreeMap<&'a str, Expression<'a>>, pub invocation_directory: &'b Result, - pub dotenv: &'b Map, + pub dotenv: &'b BTreeMap, pub dry_run: bool, - pub evaluated: Map<&'a str, String>, - pub exports: &'b Set<&'a str>, - pub overrides: &'b Map<&'b str, &'b str>, + pub evaluated: BTreeMap<&'a str, String>, + pub exports: &'b BTreeSet<&'a str>, + pub overrides: &'b BTreeMap<&'b str, &'b str>, pub quiet: bool, - pub scope: &'b Map<&'a str, String>, + pub scope: &'b BTreeMap<&'a str, String>, pub shell: &'b str, } impl<'a, 'b> AssignmentEvaluator<'a, 'b> { pub fn evaluate_assignments( - assignments: &Map<&'a str, Expression<'a>>, + assignments: &BTreeMap<&'a str, Expression<'a>>, invocation_directory: &Result, - dotenv: &'b Map, - overrides: &Map<&str, &str>, + dotenv: &'b BTreeMap, + overrides: &BTreeMap<&str, &str>, quiet: bool, shell: &'a str, dry_run: bool, - ) -> RunResult<'a, Map<&'a str, String>> { + ) -> RunResult<'a, BTreeMap<&'a str, String>> { let mut evaluator = AssignmentEvaluator { evaluated: empty(), exports: &empty(), @@ -48,7 +48,7 @@ impl<'a, 'b> AssignmentEvaluator<'a, 'b> { pub fn evaluate_line( &mut self, line: &[Fragment<'a>], - arguments: &Map<&str, Cow>, + arguments: &BTreeMap<&str, Cow>, ) -> RunResult<'a, String> { let mut evaluated = String::new(); for fragment in line { @@ -86,7 +86,7 @@ impl<'a, 'b> AssignmentEvaluator<'a, 'b> { fn evaluate_expression( &mut self, expression: &Expression<'a>, - arguments: &Map<&str, Cow>, + arguments: &BTreeMap<&str, Cow>, ) -> RunResult<'a, String> { match *expression { Expression::Variable { name, .. } => { @@ -136,7 +136,7 @@ impl<'a, 'b> AssignmentEvaluator<'a, 'b> { fn run_backtick( &self, - dotenv: &Map, + dotenv: &BTreeMap, raw: &str, token: &Token<'a>, ) -> RunResult<'a, String> { @@ -164,9 +164,8 @@ impl<'a, 'b> AssignmentEvaluator<'a, 'b> { #[cfg(test)] mod test { use super::*; + use crate::testing::parse_success; use brev::OutputError; - use testing::parse_success; - use Configuration; fn no_cwd_err() -> Result { Err(String::from("no cwd in tests")) diff --git a/src/assignment_resolver.rs b/src/assignment_resolver.rs index 27cda0f..8a8f0fc 100644 --- a/src/assignment_resolver.rs +++ b/src/assignment_resolver.rs @@ -1,19 +1,19 @@ -use common::*; +use crate::common::*; use CompilationErrorKind::*; pub struct AssignmentResolver<'a: 'b, 'b> { - assignments: &'b Map<&'a str, Expression<'a>>, - assignment_tokens: &'b Map<&'a str, Token<'a>>, + assignments: &'b BTreeMap<&'a str, Expression<'a>>, + assignment_tokens: &'b BTreeMap<&'a str, Token<'a>>, stack: Vec<&'a str>, - seen: Set<&'a str>, - evaluated: Set<&'a str>, + seen: BTreeSet<&'a str>, + evaluated: BTreeSet<&'a str>, } impl<'a: 'b, 'b> AssignmentResolver<'a, 'b> { pub fn resolve_assignments( - assignments: &Map<&'a str, Expression<'a>>, - assignment_tokens: &Map<&'a str, Token<'a>>, + assignments: &BTreeMap<&'a str, Expression<'a>>, + assignment_tokens: &BTreeMap<&'a str, Token<'a>>, ) -> CompilationResult<'a, ()> { let mut resolver = AssignmentResolver { stack: empty(), diff --git a/src/color.rs b/src/color.rs index affb080..e59821c 100644 --- a/src/color.rs +++ b/src/color.rs @@ -1,12 +1,9 @@ -extern crate ansi_term; -extern crate atty; +use crate::common::*; -use common::*; - -use self::ansi_term::Color::*; -use self::ansi_term::{ANSIGenericString, Prefix, Style, Suffix}; -use self::atty::is as is_atty; -use self::atty::Stream; +use ansi_term::Color::*; +use ansi_term::{ANSIGenericString, Prefix, Style, Suffix}; +use atty::is as is_atty; +use atty::Stream; #[derive(Copy, Clone)] pub enum UseColor { @@ -52,7 +49,7 @@ impl Color { } } - pub fn fmt(fmt: &fmt::Formatter) -> Color { + pub fn fmt(fmt: &Formatter) -> Color { if fmt.alternate() { Color::always() } else { diff --git a/src/command_ext.rs b/src/command_ext.rs index 4feeaa5..2095c22 100644 --- a/src/command_ext.rs +++ b/src/command_ext.rs @@ -1,20 +1,20 @@ -use common::*; +use crate::common::*; pub trait CommandExt { fn export_environment_variables<'a>( &mut self, - scope: &Map<&'a str, String>, - dotenv: &Map, - exports: &Set<&'a str>, + scope: &BTreeMap<&'a str, String>, + dotenv: &BTreeMap, + exports: &BTreeSet<&'a str>, ) -> RunResult<'a, ()>; } impl CommandExt for Command { fn export_environment_variables<'a>( &mut self, - scope: &Map<&'a str, String>, - dotenv: &Map, - exports: &Set<&'a str>, + scope: &BTreeMap<&'a str, String>, + dotenv: &BTreeMap, + exports: &BTreeSet<&'a str>, ) -> RunResult<'a, ()> { for (name, value) in dotenv { self.env(name, value); diff --git a/src/common.rs b/src/common.rs index eaa0d9a..eff7339 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,40 +1,57 @@ -pub use std::borrow::Cow; -pub use std::collections::{BTreeMap as Map, BTreeSet as Set}; -pub use std::fmt::Display; -pub use std::io::prelude::*; -pub use std::ops::{Range, RangeInclusive}; -pub use std::path::{Path, PathBuf}; -pub use std::process::Command; -pub use std::sync::{Mutex, MutexGuard}; -pub use std::{cmp, env, fmt, fs, io, iter, process, usize, vec}; +pub(crate) use std::{ + borrow::Cow, + cmp, + collections::{BTreeMap, BTreeSet}, + env, + fmt::{self, Display, Formatter}, + fs, io, iter, + ops::{Range, RangeInclusive}, + path::{Path, PathBuf}, + process, + process::Command, + sync::{Mutex, MutexGuard}, + usize, vec, +}; -pub use color::Color; -pub use libc::{EXIT_FAILURE, EXIT_SUCCESS}; -pub use regex::Regex; -pub use tempdir::TempDir; +pub(crate) use edit_distance::edit_distance; +pub(crate) use libc::{EXIT_FAILURE, EXIT_SUCCESS}; +pub(crate) use log::warn; +pub(crate) use regex::Regex; +pub(crate) use tempdir::TempDir; +pub(crate) use unicode_width::UnicodeWidthChar; -pub use alias::Alias; -pub use alias_resolver::AliasResolver; -pub use assignment_evaluator::AssignmentEvaluator; -pub use assignment_resolver::AssignmentResolver; -pub use command_ext::CommandExt; -pub use compilation_error::{CompilationError, CompilationErrorKind, CompilationResult}; -pub use configuration::Configuration; -pub use cooked_string::CookedString; -pub use expression::Expression; -pub use fragment::Fragment; -pub use function::{evaluate_function, resolve_function, FunctionContext}; -pub use interrupt_handler::InterruptHandler; -pub use justfile::Justfile; -pub use lexer::Lexer; -pub use load_dotenv::load_dotenv; -pub use misc::{default, empty}; -pub use parameter::Parameter; -pub use parser::Parser; -pub use range_ext::RangeExt; -pub use recipe::{Recipe, RecipeContext}; -pub use recipe_resolver::RecipeResolver; -pub use runtime_error::{RunResult, RuntimeError}; -pub use shebang::Shebang; -pub use token::{Token, TokenKind}; -pub use verbosity::Verbosity; +pub(crate) use crate::{ + alias::Alias, + alias_resolver::AliasResolver, + assignment_evaluator::AssignmentEvaluator, + assignment_resolver::AssignmentResolver, + color::Color, + compilation_error::{CompilationError, CompilationErrorKind, CompilationResult}, + configuration::Configuration, + cooked_string::CookedString, + expression::Expression, + fragment::Fragment, + function::{evaluate_function, resolve_function, FunctionContext}, + interrupt_handler::InterruptHandler, + justfile::Justfile, + lexer::Lexer, + load_dotenv::load_dotenv, + misc::{default, empty}, + parameter::Parameter, + parser::Parser, + recipe::{Recipe, RecipeContext}, + recipe_resolver::RecipeResolver, + runtime_error::{RunResult, RuntimeError}, + shebang::Shebang, + token::{Token, TokenKind}, + verbosity::Verbosity, +}; + +#[allow(unused_imports)] +pub(crate) use std::io::prelude::*; + +#[allow(unused_imports)] +pub(crate) use crate::command_ext::CommandExt; + +#[allow(unused_imports)] +pub(crate) use crate::range_ext::RangeExt; diff --git a/src/compilation_error.rs b/src/compilation_error.rs index 545d10f..5c53f5a 100644 --- a/src/compilation_error.rs +++ b/src/compilation_error.rs @@ -1,6 +1,6 @@ -use common::*; +use crate::common::*; -use misc::{maybe_s, show_whitespace, write_error_context, Or}; +use crate::misc::{maybe_s, show_whitespace, write_error_context, Or}; pub type CompilationResult<'a, T> = Result>; @@ -103,7 +103,7 @@ pub enum CompilationErrorKind<'a> { } impl<'a> Display for CompilationError<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { use CompilationErrorKind::*; let error = Color::fmt(f).error(); let message = Color::fmt(f).message(); diff --git a/src/configuration.rs b/src/configuration.rs index 63dae66..03f4dd9 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; pub const DEFAULT_SHELL: &str = "sh"; @@ -6,7 +6,7 @@ pub struct Configuration<'a> { pub dry_run: bool, pub evaluate: bool, pub highlight: bool, - pub overrides: Map<&'a str, &'a str>, + pub overrides: BTreeMap<&'a str, &'a str>, pub quiet: bool, pub shell: &'a str, pub color: Color, diff --git a/src/cooked_string.rs b/src/cooked_string.rs index a691221..0f7f910 100644 --- a/src/cooked_string.rs +++ b/src/cooked_string.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; #[derive(PartialEq, Debug)] pub struct CookedString<'a> { diff --git a/src/die.rs b/src/die.rs index 4c1e62d..19dd0c3 100644 --- a/src/die.rs +++ b/src/die.rs @@ -1,7 +1,6 @@ macro_rules! die { ($($arg:tt)*) => {{ - extern crate std; eprintln!($($arg)*); - process::exit(EXIT_FAILURE) + std::process::exit(EXIT_FAILURE) }}; } diff --git a/src/expression.rs b/src/expression.rs index f2a26b1..18f1511 100644 --- a/src/expression.rs +++ b/src/expression.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; #[derive(PartialEq, Debug)] pub enum Expression<'a> { @@ -35,7 +35,7 @@ impl<'a> Expression<'a> { } impl<'a> Display for Expression<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { match *self { Expression::Backtick { raw, .. } => write!(f, "`{}`", raw)?, Expression::Concatination { ref lhs, ref rhs } => write!(f, "{} + {}", lhs, rhs)?, diff --git a/src/fragment.rs b/src/fragment.rs index 1cb3d59..78057d3 100644 --- a/src/fragment.rs +++ b/src/fragment.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; #[derive(PartialEq, Debug)] pub enum Fragment<'a> { diff --git a/src/function.rs b/src/function.rs index 590826e..039db22 100644 --- a/src/function.rs +++ b/src/function.rs @@ -1,11 +1,11 @@ -use common::*; +use crate::common::*; use target; -use platform::{Platform, PlatformInterface}; +use crate::platform::{Platform, PlatformInterface}; lazy_static! { - static ref FUNCTIONS: Map<&'static str, Function> = vec![ + static ref FUNCTIONS: BTreeMap<&'static str, Function> = vec![ ("arch", Function::Nullary(arch)), ("os", Function::Nullary(os)), ("os_family", Function::Nullary(os_family)), @@ -39,7 +39,7 @@ impl Function { pub struct FunctionContext<'a> { pub invocation_directory: &'a Result, - pub dotenv: &'a Map, + pub dotenv: &'a BTreeMap, } pub fn resolve_function<'a>(token: &Token<'a>, argc: usize) -> CompilationResult<'a, ()> { diff --git a/src/fuzzing.rs b/src/fuzzing.rs index 91524d3..6dfe0f2 100644 --- a/src/fuzzing.rs +++ b/src/fuzzing.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; pub fn compile(text: &str) { if let Err(error) = Parser::parse(text) { diff --git a/src/interrupt_handler.rs b/src/interrupt_handler.rs index b9bf533..4f3a8fa 100644 --- a/src/interrupt_handler.rs +++ b/src/interrupt_handler.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; use ctrlc; diff --git a/src/justfile.rs b/src/justfile.rs index 63dff63..ee25d11 100644 --- a/src/justfile.rs +++ b/src/justfile.rs @@ -1,12 +1,10 @@ -use common::*; - -use edit_distance::edit_distance; +use crate::common::*; pub struct Justfile<'a> { - pub recipes: Map<&'a str, Recipe<'a>>, - pub assignments: Map<&'a str, Expression<'a>>, - pub exports: Set<&'a str>, - pub aliases: Map<&'a str, Alias<'a>>, + pub recipes: BTreeMap<&'a str, Recipe<'a>>, + pub assignments: BTreeMap<&'a str, Expression<'a>>, + pub exports: BTreeSet<&'a str>, + pub aliases: BTreeMap<&'a str, Alias<'a>>, } impl<'a> Justfile<'a> where { @@ -155,8 +153,8 @@ impl<'a> Justfile<'a> where { context: &'b RecipeContext<'a>, recipe: &Recipe<'a>, arguments: &[&'a str], - dotenv: &Map, - ran: &mut Set<&'a str>, + dotenv: &BTreeMap, + ran: &mut BTreeSet<&'a str>, ) -> RunResult<()> { for dependency_name in &recipe.dependencies { if !ran.contains(dependency_name) { @@ -170,7 +168,7 @@ impl<'a> Justfile<'a> where { } impl<'a> Display for Justfile<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { let mut items = self.recipes.len() + self.assignments.len() + self.aliases.len(); for (name, expression) in &self.assignments { if self.exports.contains(name) { @@ -183,7 +181,7 @@ impl<'a> Display for Justfile<'a> { } } for alias in self.aliases.values() { - write!(f, "{}",alias)?; + write!(f, "{}", alias)?; items -= 1; if items != 0 { write!(f, "\n\n")?; @@ -203,8 +201,9 @@ impl<'a> Display for Justfile<'a> { #[cfg(test)] mod test { use super::*; - use testing::parse_success; - use RuntimeError::*; + + use crate::runtime_error::RuntimeError::*; + use crate::testing::parse_success; fn no_cwd_err() -> Result { Err(String::from("no cwd in tests")) diff --git a/src/lexer.rs b/src/lexer.rs index 6f10282..01c6b22 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; use CompilationErrorKind::*; use TokenKind::*; @@ -383,7 +383,7 @@ mod test { fn $name() { let input = $input; let expected = $expected; - let tokens = ::Lexer::lex(input).unwrap(); + let tokens = crate::lexer::Lexer::lex(input).unwrap(); let roundtrip = tokens .iter() .map(|t| { @@ -688,7 +688,7 @@ c: b error_test! { name: unterminated_interpolation, input: "foo:\n echo {{ -", + ", index: 13, line: 1, column: 8, diff --git a/src/lib.rs b/src/lib.rs index b6fdd91..2742f4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,21 +1,5 @@ #[macro_use] extern crate lazy_static; -#[macro_use] -extern crate log; - -extern crate ansi_term; -extern crate brev; -extern crate clap; -extern crate ctrlc; -extern crate dotenv; -extern crate edit_distance; -extern crate env_logger; -extern crate itertools; -extern crate libc; -extern crate regex; -extern crate target; -extern crate tempdir; -extern crate unicode_width; #[cfg(test)] #[macro_use] @@ -57,6 +41,4 @@ mod shebang; mod token; mod verbosity; -use common::*; - -pub use run::run; +pub use crate::run::run; diff --git a/src/load_dotenv.rs b/src/load_dotenv.rs index de55799..8ebcad5 100644 --- a/src/load_dotenv.rs +++ b/src/load_dotenv.rs @@ -1,16 +1,14 @@ -use common::*; +use crate::common::*; -use dotenv; - -pub fn load_dotenv() -> RunResult<'static, Map> { +pub fn load_dotenv() -> RunResult<'static, BTreeMap> { match dotenv::dotenv_iter() { Ok(iter) => { - let result: dotenv::Result> = iter.collect(); + let result: dotenv::Result> = iter.collect(); result.map_err(|dotenv_error| RuntimeError::Dotenv { dotenv_error }) } Err(dotenv_error) => { if dotenv_error.not_found() { - Ok(Map::new()) + Ok(BTreeMap::new()) } else { Err(RuntimeError::Dotenv { dotenv_error }) } diff --git a/src/main.rs b/src/main.rs index cd9497f..f0e8c9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -extern crate just; - fn main() { just::run(); } diff --git a/src/misc.rs b/src/misc.rs index 86fb724..a5b64c0 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -1,6 +1,4 @@ -use common::*; - -use unicode_width::UnicodeWidthChar; +use crate::common::*; pub fn show_whitespace(text: &str) -> String { text @@ -34,7 +32,7 @@ pub fn maybe_s(n: usize) -> &'static str { } pub fn conjoin( - f: &mut fmt::Formatter, + f: &mut Formatter, values: &[T], conjunction: &str, ) -> Result<(), fmt::Error> { @@ -58,7 +56,7 @@ pub fn conjoin( } pub fn write_error_context( - f: &mut fmt::Formatter, + f: &mut Formatter, text: &str, index: usize, line: usize, @@ -135,7 +133,7 @@ pub fn write_error_context( pub struct And<'a, T: 'a + Display>(pub &'a [T]); impl<'a, T: Display> Display for And<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { conjoin(f, self.0, "and") } } @@ -143,7 +141,7 @@ impl<'a, T: Display> Display for And<'a, T> { pub struct Or<'a, T: 'a + Display>(pub &'a [T]); impl<'a, T: Display> Display for Or<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { conjoin(f, self.0, "or") } } @@ -151,7 +149,7 @@ impl<'a, T: Display> Display for Or<'a, T> { pub struct Tick<'a, T: 'a + Display>(pub &'a T); impl<'a, T: Display> Display for Tick<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { write!(f, "`{}`", self.0) } } diff --git a/src/parameter.rs b/src/parameter.rs index 5945fae..e5c6600 100644 --- a/src/parameter.rs +++ b/src/parameter.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; #[derive(PartialEq, Debug)] pub struct Parameter<'a> { @@ -9,7 +9,7 @@ pub struct Parameter<'a> { } impl<'a> Display for Parameter<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { let color = Color::fmt(f); if self.variadic { write!(f, "{}", color.annotation().paint("+"))?; diff --git a/src/parser.rs b/src/parser.rs index 35e8fd7..497434e 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,18 +1,17 @@ -use common::*; +use crate::common::*; -use itertools; use CompilationErrorKind::*; use TokenKind::*; pub struct Parser<'a> { text: &'a str, tokens: itertools::PutBackN>>, - recipes: Map<&'a str, Recipe<'a>>, - assignments: Map<&'a str, Expression<'a>>, - assignment_tokens: Map<&'a str, Token<'a>>, - exports: Set<&'a str>, - aliases: Map<&'a str, Alias<'a>>, - alias_tokens: Map<&'a str, Token<'a>>, + recipes: BTreeMap<&'a str, Recipe<'a>>, + assignments: BTreeMap<&'a str, Expression<'a>>, + assignment_tokens: BTreeMap<&'a str, Token<'a>>, + exports: BTreeSet<&'a str>, + aliases: BTreeMap<&'a str, Alias<'a>>, + alias_tokens: BTreeMap<&'a str, Token<'a>>, } impl<'a> Parser<'a> { @@ -500,8 +499,8 @@ impl<'a> Parser<'a> { #[cfg(test)] mod test { use super::*; + use crate::testing::parse_success; use brev; - use testing::parse_success; macro_rules! summary_test { ($name:ident, $input:expr, $expected:expr $(,)*) => { @@ -587,14 +586,14 @@ export a = "hello" summary_test! { parse_alias_after_target, r#" -foo: +foo: echo a alias f = foo "#, r#"alias f = foo foo: - echo a"# + echo a"# } summary_test! { @@ -614,7 +613,7 @@ foo: parse_alias_with_comment, r#" alias f = foo #comment -foo: +foo: echo a "#, r#"alias f = foo @@ -714,7 +713,7 @@ c = a + b + a + b", summary_test! { parse_interpolation_backticks, r#"a: - echo {{ `echo hello` + "blarg" }} {{ `echo bob` }}"#, + echo {{ `echo hello` + "blarg" }} {{ `echo bob` }}"#, r#"a: echo {{`echo hello` + "blarg"}} {{`echo bob`}}"#, } diff --git a/src/platform.rs b/src/platform.rs index 7e8c528..56a7ae1 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -1,6 +1,4 @@ -use common::*; - -use brev; +use crate::common::*; pub struct Platform; diff --git a/src/range_ext.rs b/src/range_ext.rs index 3de2c16..002c820 100644 --- a/src/range_ext.rs +++ b/src/range_ext.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; pub trait RangeExt { fn range_contains(&self, i: &T) -> bool; @@ -6,7 +6,7 @@ pub trait RangeExt { impl RangeExt for Range where - T: PartialOrd + Copy, + T: PartialOrd, { fn range_contains(&self, i: &T) -> bool { i >= &self.start && i < &self.end @@ -15,7 +15,7 @@ where impl RangeExt for RangeInclusive where - T: PartialOrd + Copy, + T: PartialOrd, { fn range_contains(&self, i: &T) -> bool { i >= self.start() && i <= self.end() @@ -27,20 +27,30 @@ mod test { use super::*; #[test] - fn range() { - assert!((0..1).range_contains(&0)); - assert!((10..20).range_contains(&15)); + fn exclusive() { + assert!(!(0..0).range_contains(&0)); assert!(!(0..0).range_contains(&0)); assert!(!(1..10).range_contains(&0)); assert!(!(1..10).range_contains(&10)); + assert!(!(1..10).range_contains(&0)); + assert!(!(1..10).range_contains(&10)); + assert!((0..1).range_contains(&0)); + assert!((0..1).range_contains(&0)); + assert!((10..20).range_contains(&15)); + assert!((10..20).range_contains(&15)); } #[test] - fn range_inclusive() { - assert!((0..=10).range_contains(&0)); - assert!((0..=10).range_contains(&7)); - assert!((0..=10).range_contains(&10)); + fn inclusive() { assert!(!(0..=10).range_contains(&11)); + assert!(!(1..=10).range_contains(&0)); assert!(!(5..=10).range_contains(&4)); + assert!((0..=0).range_contains(&0)); + assert!((0..=1).range_contains(&0)); + assert!((0..=10).range_contains(&0)); + assert!((0..=10).range_contains(&10)); + assert!((0..=10).range_contains(&7)); + assert!((1..=10).range_contains(&10)); + assert!((10..=20).range_contains(&15)); } } diff --git a/src/recipe.rs b/src/recipe.rs index 623b0d3..87383a6 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -1,8 +1,8 @@ -use common::*; +use crate::common::*; use std::process::{Command, ExitStatus, Stdio}; -use platform::{Platform, PlatformInterface}; +use crate::platform::{Platform, PlatformInterface}; /// Return a `RuntimeError::Signal` if the process was terminated by a signal, /// otherwise return an `RuntimeError::UnknownFailure` @@ -41,7 +41,7 @@ pub struct Recipe<'a> { pub struct RecipeContext<'a> { pub invocation_directory: &'a Result, pub configuration: &'a Configuration<'a>, - pub scope: Map<&'a str, String>, + pub scope: BTreeMap<&'a str, String>, } impl<'a> Recipe<'a> { @@ -69,8 +69,8 @@ impl<'a> Recipe<'a> { &self, context: &RecipeContext<'a>, arguments: &[&'a str], - dotenv: &Map, - exports: &Set<&'a str>, + dotenv: &BTreeMap, + exports: &BTreeSet<&'a str>, ) -> RunResult<'a, ()> { let configuration = &context.configuration; @@ -84,7 +84,7 @@ impl<'a> Recipe<'a> { ); } - let mut argument_map = Map::new(); + let mut argument_map = BTreeMap::new(); let mut rest = arguments; for parameter in &self.parameters { @@ -315,7 +315,7 @@ impl<'a> Recipe<'a> { } impl<'a> Display for Recipe<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { if let Some(doc) = self.doc { writeln!(f, "# {}", doc)?; } diff --git a/src/recipe_resolver.rs b/src/recipe_resolver.rs index 53c87d6..f9a5ea7 100644 --- a/src/recipe_resolver.rs +++ b/src/recipe_resolver.rs @@ -1,18 +1,18 @@ -use common::*; +use crate::common::*; use CompilationErrorKind::*; pub struct RecipeResolver<'a: 'b, 'b> { stack: Vec<&'a str>, - seen: Set<&'a str>, - resolved: Set<&'a str>, - recipes: &'b Map<&'a str, Recipe<'a>>, + seen: BTreeSet<&'a str>, + resolved: BTreeSet<&'a str>, + recipes: &'b BTreeMap<&'a str, Recipe<'a>>, } impl<'a, 'b> RecipeResolver<'a, 'b> { pub fn resolve_recipes( - recipes: &Map<&'a str, Recipe<'a>>, - assignments: &Map<&'a str, Expression<'a>>, + recipes: &BTreeMap<&'a str, Recipe<'a>>, + assignments: &BTreeMap<&'a str, Expression<'a>>, text: &'a str, ) -> CompilationResult<'a, ()> { let mut resolver = RecipeResolver { diff --git a/src/run.rs b/src/run.rs index b074bec..0f2c2f7 100644 --- a/src/run.rs +++ b/src/run.rs @@ -1,10 +1,9 @@ -use common::*; +use crate::common::*; +use crate::configuration::DEFAULT_SHELL; +use crate::interrupt_handler::InterruptHandler; +use crate::misc::maybe_s; use clap::{App, AppSettings, Arg, ArgGroup}; -use configuration::DEFAULT_SHELL; -use env_logger; -use interrupt_handler::InterruptHandler; -use misc::maybe_s; use std::{convert, ffi}; use unicode_width::UnicodeWidthStr; @@ -187,7 +186,7 @@ pub fn run() { }; let set_count = matches.occurrences_of("SET"); - let mut overrides = Map::new(); + let mut overrides = BTreeMap::new(); if set_count > 0 { let mut values = matches.values_of("SET").unwrap(); for _ in 0..set_count { @@ -197,9 +196,9 @@ pub fn run() { let override_re = Regex::new("^([^=]+)=(.*)$").unwrap(); - let raw_arguments = matches + let raw_arguments: Vec<_> = matches .values_of("ARGUMENTS") - .map(|values| values.collect::>()) + .map(Iterator::collect) .unwrap_or_default(); for argument in raw_arguments @@ -357,7 +356,7 @@ pub fn run() { if matches.is_present("LIST") { // Construct a target to alias map. - let mut recipe_aliases: Map<&str, Vec<&str>> = Map::new(); + let mut recipe_aliases: BTreeMap<&str, Vec<&str>> = BTreeMap::new(); for alias in justfile.aliases.values() { if !recipe_aliases.contains_key(alias.target) { recipe_aliases.insert(alias.target, vec![alias.name]); @@ -367,7 +366,7 @@ pub fn run() { } } - let mut line_widths: Map<&str, usize> = Map::new(); + let mut line_widths: BTreeMap<&str, usize> = BTreeMap::new(); for (name, recipe) in &justfile.recipes { if recipe.private { @@ -399,7 +398,10 @@ pub fn run() { let alias_doc = format!("alias for `{}`", recipe.name); - for (i, name) in iter::once(name).chain(recipe_aliases.get(name).unwrap_or(&Vec::new())).enumerate() { + for (i, name) in iter::once(name) + .chain(recipe_aliases.get(name).unwrap_or(&Vec::new())) + .enumerate() + { print!(" {}", name); for parameter in &recipe.parameters { if color.stdout().active() { @@ -409,7 +411,7 @@ pub fn run() { } } - // Declaring this outside of the nested loops will probably be more efficient, but + // Declaring this outside of the nested loops will probably be more efficient, but // it creates all sorts of lifetime issues with variables inside the loops. // If this is inlined like the docs say, it shouldn't make any difference. let print_doc = |doc| { @@ -418,15 +420,15 @@ pub fn run() { "", doc_color.paint("#"), doc_color.paint(doc), - padding = - max_line_width.saturating_sub(line_widths.get(name).cloned().unwrap_or(max_line_width)) + padding = max_line_width + .saturating_sub(line_widths.get(name).cloned().unwrap_or(max_line_width)) ); }; match (i, recipe.doc) { (0, Some(doc)) => print_doc(doc), - (0, None) => (), - _ => print_doc(&alias_doc), + (0, None) => (), + _ => print_doc(&alias_doc), } println!(); } diff --git a/src/runtime_error.rs b/src/runtime_error.rs index 26060aa..277c638 100644 --- a/src/runtime_error.rs +++ b/src/runtime_error.rs @@ -1,16 +1,12 @@ -use common::*; - -use dotenv; +use crate::common::*; use brev::OutputError; -use misc::{maybe_s, ticks, write_error_context, And, Or, Tick}; - -use self::RuntimeError::*; +use crate::misc::{maybe_s, ticks, write_error_context, And, Or, Tick}; pub type RunResult<'a, T> = Result>; -fn write_token_error_context(f: &mut fmt::Formatter, token: &Token) -> Result<(), fmt::Error> { +fn write_token_error_context(f: &mut Formatter, token: &Token) -> Result<(), fmt::Error> { write_error_context( f, token.text, @@ -87,6 +83,7 @@ pub enum RuntimeError<'a> { impl<'a> RuntimeError<'a> { pub fn code(&self) -> Option { + use RuntimeError::*; match *self { Code { code, .. } | Backtick { @@ -99,8 +96,9 @@ impl<'a> RuntimeError<'a> { } impl<'a> Display for RuntimeError<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { use RuntimeError::*; + let color = if f.alternate() { Color::always() } else { diff --git a/src/testing.rs b/src/testing.rs index 6c84497..3790241 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; pub fn parse_success(text: &str) -> Justfile { match Parser::parse(text) { @@ -21,7 +21,7 @@ macro_rules! compilation_error_test { fn $name() { let input = $input; - let expected = ::CompilationError { + let expected = crate::compilation_error::CompilationError { text: input, index: $index, line: $line, @@ -30,8 +30,8 @@ macro_rules! compilation_error_test { kind: $kind, }; - let tokens = ::Lexer::lex(input).unwrap(); - let parser = ::Parser::new(input, tokens); + let tokens = crate::lexer::Lexer::lex(input).unwrap(); + let parser = crate::parser::Parser::new(input, tokens); if let Err(error) = parser.justfile() { assert_eq!(error.text, expected.text); diff --git a/src/token.rs b/src/token.rs index 6321ec9..268edb0 100644 --- a/src/token.rs +++ b/src/token.rs @@ -1,4 +1,4 @@ -use common::*; +use crate::common::*; #[derive(Debug, PartialEq, Clone)] pub struct Token<'a> { @@ -49,7 +49,7 @@ pub enum TokenKind { } impl Display for TokenKind { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> { use TokenKind::*; write!( f, diff --git a/tests/integration.rs b/tests/integration.rs index 5c8a23e..f94f7e1 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1,9 +1,3 @@ -extern crate brev; -extern crate executable_path; -extern crate libc; -extern crate target; -extern crate tempdir; - use executable_path::executable_path; use libc::{EXIT_FAILURE, EXIT_SUCCESS}; use std::env; diff --git a/tests/interrupts.rs b/tests/interrupts.rs index caddb77..33280b5 100644 --- a/tests/interrupts.rs +++ b/tests/interrupts.rs @@ -1,8 +1,3 @@ -extern crate brev; -extern crate executable_path; -extern crate libc; -extern crate tempdir; - use executable_path::executable_path; use std::{ process::Command, diff --git a/tests/invocation_directory.rs b/tests/invocation_directory.rs index ad00dbb..5e3e7b3 100644 --- a/tests/invocation_directory.rs +++ b/tests/invocation_directory.rs @@ -1,8 +1,3 @@ -extern crate brev; -extern crate executable_path; -extern crate target; -extern crate tempdir; - use executable_path::executable_path; use std::path::Path; use std::process; diff --git a/tests/search.rs b/tests/search.rs index caf7e30..8ecca04 100644 --- a/tests/search.rs +++ b/tests/search.rs @@ -1,7 +1,3 @@ -extern crate brev; -extern crate executable_path; -extern crate tempdir; - use executable_path::executable_path; use std::{fs, path, process, str}; use tempdir::TempDir; diff --git a/tests/working_directory.rs b/tests/working_directory.rs index 7bd3749..669ff42 100644 --- a/tests/working_directory.rs +++ b/tests/working_directory.rs @@ -1,6 +1,3 @@ -extern crate executable_path; -extern crate tempdir; - use executable_path::executable_path; use std::{error::Error, fs, process::Command}; use tempdir::TempDir;