From 94ecd810ec3c4d235a8959eedefc69980ddaeb5c Mon Sep 17 00:00:00 2001 From: Filipe Rodrigues Date: Wed, 23 Aug 2023 13:30:37 +0100 Subject: [PATCH] Updated to `rustc 1.73.0-nightly (399b06823 2023-07-20)`. --- Cargo.toml | 12 +++++++----- src/build.rs | 12 +++++++----- src/main.rs | 2 ++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bdbe0de..212834e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,10 +103,14 @@ clippy.mem_forget = "allow" clippy.shadow_same = "allow" clippy.shadow_reuse = "allow" clippy.shadow_unrelated = "allow" # TODO: Maybe check this one every once in a while? Pretty noisy though -clippy.wildcard_enum_match_arm = "allow" +clippy.min_ident_chars = "allow" # Useful for generics such as `f: impl FnOnce()` +clippy.single_call_fn = "allow" # It's still useful to separate blocks of code into functions clippy.float_arithmetic = "allow" -clippy.default_numeric_fallback = "allow" -clippy.print_stdout = "allow" +clippy.default_numeric_fallback = "allow" # TODO: This isn't very useful for floats, but might be for integers + +# We prefer the short version +clippy.pub_with_shorthand = "allow" +clippy.pub_without_shorthand = "warn" # Triggers in macro-generated code # TODO: Turn these on once they don't trigger in macro-generated code @@ -137,8 +141,6 @@ clippy.separated_literal_suffix = "allow" # Matching on a vale and adding `ref` is easier than matching on ref and de-referencing values within the body clippy.ref_patterns = "allow" clippy.semicolon_outside_block = "allow" -clippy.manual_let_else = "allow" # Rustfmt doesn't support let-else yet - # Performance of floats isn't paramount clippy.suboptimal_flops = "allow" diff --git a/src/build.rs b/src/build.rs index 8d0b12c..1293047 100644 --- a/src/build.rs +++ b/src/build.rs @@ -173,7 +173,9 @@ impl<'s> Builder<'s> { /// Resets a build pub async fn reset_build(&self, target: &Target<'s, CowStr<'s>>, rules: &Rules<'s>) -> Result<(), AppError> { // Get the rule for the target - let Some((_, target_rule)) = self.target_rule(target, rules)? else { return Ok(()) }; + let Some((_, target_rule)) = self.target_rule(target, rules)? else { + return Ok(()); + }; // Get the built lock, or create it // Note: Important to clone since we'll be `await`ing with it. @@ -225,9 +227,8 @@ impl<'s> Builder<'s> { }; // Get the rule for the target - let (rule, target_rule) = match self.target_rule(&target, rules)? { - Some((rule, target_rule)) => (rule, target_rule), - None => match target { + let Some((rule, target_rule)) = self.target_rule(&target, rules)? else { + match target { Target::File { ref file, .. } => match fs::metadata(&**file).await { Ok(metadata) => { let build_time = self::file_modified_time(metadata); @@ -262,7 +263,7 @@ impl<'s> Builder<'s> { }, // Note: If `target_rule` returns `Err` if this was a rule, so we can never reach here Target::Rule { .. } => unreachable!(), - }, + } }; // Get the built lock, or create it @@ -456,6 +457,7 @@ impl<'s> Builder<'s> { }; // If the dependency if a dependency deps file or an output deps file (and exists), build it's dependencies too + #[allow(clippy::wildcard_enum_match_arm, reason = "We only care about some variants")] let dep_deps = match &dep { Dep::File { file, diff --git a/src/main.rs b/src/main.rs index d503c1d..30df696 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,8 @@ strict_provenance, assert_matches )] +// Lints +#![allow(clippy::print_stdout, reason = "We're a binary that should talk to the user")] // Modules mod args;