diff options
| author | mo8it <mo8it@proton.me> | 2024-08-22 14:25:14 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-08-22 14:25:14 +0200 |
| commit | bedf0789f2129f333cc1af14775c40d7312297f5 (patch) | |
| tree | 052bf1b74a6a6fee7b8aef9f80ce50ddc40e54e2 /src | |
| parent | a2d1cb3b2246f50ea36408f2be1962f5dc69d09b (diff) | |
Always use strict Clippy when checking solutions
Diffstat (limited to 'src')
| -rw-r--r-- | src/exercise.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/exercise.rs b/src/exercise.rs index cdac2e2..5318b9a 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -72,7 +72,7 @@ pub trait RunnableExercise { // Compile, check and run the exercise or its solution (depending on `bin_name“). // The output is written to the `output` buffer after clearing it. - fn run( + fn run<const FORCE_STRICT_CLIPPY: bool>( &self, bin_name: &str, mut output: Option<&mut Vec<u8>>, @@ -115,7 +115,7 @@ pub trait RunnableExercise { let mut clippy_cmd = cmd_runner.cargo("clippy", bin_name, output.as_deref_mut()); // `--profile test` is required to also check code with `[cfg(test)]`. - if self.strict_clippy() { + if FORCE_STRICT_CLIPPY || self.strict_clippy() { clippy_cmd.args(["--profile", "test", "--", "-D", "warnings"]); } else { clippy_cmd.args(["--profile", "test"]); @@ -131,7 +131,7 @@ pub trait RunnableExercise { /// The output is written to the `output` buffer after clearing it. #[inline] fn run_exercise(&self, output: Option<&mut Vec<u8>>, cmd_runner: &CmdRunner) -> Result<bool> { - self.run(self.name(), output, cmd_runner) + self.run::<false>(self.name(), output, cmd_runner) } /// Compile, check and run the exercise's solution. @@ -142,7 +142,7 @@ pub trait RunnableExercise { bin_name.push_str(name); bin_name.push_str("_sol"); - self.run(&bin_name, output, cmd_runner) + self.run::<true>(&bin_name, output, cmd_runner) } } |
