diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 132453f2..381daa06 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -22,7 +22,7 @@ jobs: - macos-latest - windows-latest rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index fb9707be..5092ade2 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -26,7 +26,7 @@ jobs: - macos-latest - windows-latest rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable runs-on: ${{ matrix.platform }} steps: @@ -47,7 +47,7 @@ jobs: - macos-latest - windows-latest rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/derive.yml b/.github/workflows/derive.yml index adf6b195..21d69f44 100644 --- a/.github/workflows/derive.yml +++ b/.github/workflows/derive.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.56.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/tokio.yml b/.github/workflows/tokio.yml index 8e0e410e..19dbb9cd 100644 --- a/.github/workflows/tokio.yml +++ b/.github/workflows/tokio.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: rust: - - 1.56.0 # MSRV + - 1.57 # MSRV - stable steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 4a29af06..76f28c88 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.56.0 # MSRV + toolchain: 1.57.0 # MSRV components: clippy override: true profile: minimal diff --git a/Cargo.lock b/Cargo.lock index 980d41c0..6cfd16cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -209,9 +209,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.1.16" +version = "3.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52d4f8e4a1419219935762e32913b4430f37cb0c0200ad17a89ee18c0188a9f" +checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" dependencies = [ "atty", "bitflags", @@ -226,9 +226,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.7" +version = "3.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" +checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" dependencies = [ "heck", "proc-macro-error", @@ -313,16 +313,16 @@ checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "handlebars" -version = "4.2.2" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d6a30320f094710245150395bc763ad23128d6a1ebbad7594dc4164b62c56b" +checksum = "d113a9853e5accd30f43003560b5563ffbb007e3f325e8b103fa0d0029c6e6df" dependencies = [ "log", "pest", "pest_derive", - "quick-error", "serde", "serde_json", + "thiserror", ] [[package]] @@ -370,9 +370,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "lazy_static" @@ -382,9 +382,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.125" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "lock_api" @@ -398,9 +398,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] @@ -437,34 +437,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" dependencies = [ "libc", "log", - "miow", - "ntapi", "wasi", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", + "windows-sys", ] [[package]] @@ -479,18 +459,18 @@ dependencies = [ [[package]] name = "object" -version = "0.28.3" +version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "opaque-debug" @@ -500,9 +480,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "os_str_bytes" -version = "6.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" [[package]] name = "owo-colors" @@ -608,19 +588,13 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - [[package]] name = "quote" version = "1.0.18" @@ -641,9 +615,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "aho-corasick", "memchr", @@ -661,9 +635,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "rustc-demangle" @@ -673,9 +647,9 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "scopeguard" @@ -724,9 +698,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f972498cf015f7c0746cac89ebe1d6ef10c293b94175a243a2d9442c163d9944" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "itoa", "ryu", @@ -787,13 +761,13 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -823,6 +797,26 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.4" @@ -834,9 +828,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.18.1" +version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce653fb475565de9f6fb0614b28bca8df2c430c0cf84bcd9c843f15de5414cc" +checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" dependencies = [ "libc", "mio", @@ -932,6 +926,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + [[package]] name = "unicode-xid" version = "0.2.3" diff --git a/cli/src/commands/gen/cmd.rs b/cli/src/commands/gen/cmd.rs index ea34d61f..4f63b20a 100644 --- a/cli/src/commands/gen/cmd.rs +++ b/cli/src/commands/gen/cmd.rs @@ -43,7 +43,7 @@ impl Runnable for Cmd { impl Cmd { /// Generate a new subcommand in this application pub fn generate(&self, app_root: &Path, name: &str) { - let snake_case_name = name.replace("-", "_"); + let snake_case_name = name.replace('-', "_"); let output_dir = app_root.join("src").join("commands"); if !output_dir.exists() { diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 2acddc4c..63a785c9 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -40,10 +40,12 @@ impl Runnable for NewCommand { /// Run the Abscissa application generator fn run(&self) { let started_at = Instant::now(); + #[allow(clippy::redundant_closure)] let app_properties = self.parse_options().unwrap_or_else(|e| fatal_error(e)); let app_template = Collection::default(); let branch_name = "main"; + #[allow(clippy::redundant_closure)] self.create_parent_directory() .unwrap_or_else(|e| fatal_error(e)); @@ -52,15 +54,18 @@ impl Runnable for NewCommand { template_files.sort_by(|a, b| a.name().cmp(b.name())); for template_file in &template_files { + #[allow(clippy::redundant_closure)] self.render_template_file(&app_template, template_file, &app_properties) .unwrap_or_else(|e| fatal_error(e)); } // TODO(tarcieri): make this optional? + #[allow(clippy::redundant_closure)] self.run_git_init(branch_name) .unwrap_or_else(|e| fatal_error(e)); // TODO(tarcieri): make this optional? + #[allow(clippy::redundant_closure)] self.generate_lockfile().unwrap_or_else(|e| fatal_error(e)); let duration = started_at.elapsed(); @@ -265,7 +270,7 @@ impl NewCommand { .file_name() .expect("no filename?") .to_string_lossy() - .replace("-", "_"); + .replace('-', "_"); let name: properties::name::App = app_name.parse().expect("no app name"); diff --git a/core/src/application/cell.rs b/core/src/application/cell.rs index 0573f9d5..3a2e30d7 100644 --- a/core/src/application/cell.rs +++ b/core/src/application/cell.rs @@ -34,6 +34,7 @@ where { type Target = A; + #[allow(clippy::redundant_closure)] fn deref(&self) -> &A { self.0.get().unwrap_or_else(|| not_loaded()) } diff --git a/core/src/config/cell.rs b/core/src/config/cell.rs index d7d03144..738048fc 100644 --- a/core/src/config/cell.rs +++ b/core/src/config/cell.rs @@ -27,6 +27,7 @@ where } /// Read the current configuration. + #[allow(clippy::redundant_closure)] pub fn read(&self) -> Reader { self.inner.load_full().unwrap_or_else(|| not_loaded()) }