Skip to content

Commit bedf078

Browse files
committed
Always use strict Clippy when checking solutions
1 parent a2d1cb3 commit bedf078

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/exercise.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub trait RunnableExercise {
7272

7373
// Compile, check and run the exercise or its solution (depending on `bin_name´).
7474
// The output is written to the `output` buffer after clearing it.
75-
fn run(
75+
fn run<const FORCE_STRICT_CLIPPY: bool>(
7676
&self,
7777
bin_name: &str,
7878
mut output: Option<&mut Vec<u8>>,
@@ -115,7 +115,7 @@ pub trait RunnableExercise {
115115
let mut clippy_cmd = cmd_runner.cargo("clippy", bin_name, output.as_deref_mut());
116116

117117
// `--profile test` is required to also check code with `[cfg(test)]`.
118-
if self.strict_clippy() {
118+
if FORCE_STRICT_CLIPPY || self.strict_clippy() {
119119
clippy_cmd.args(["--profile", "test", "--", "-D", "warnings"]);
120120
} else {
121121
clippy_cmd.args(["--profile", "test"]);
@@ -131,7 +131,7 @@ pub trait RunnableExercise {
131131
/// The output is written to the `output` buffer after clearing it.
132132
#[inline]
133133
fn run_exercise(&self, output: Option<&mut Vec<u8>>, cmd_runner: &CmdRunner) -> Result<bool> {
134-
self.run(self.name(), output, cmd_runner)
134+
self.run::<false>(self.name(), output, cmd_runner)
135135
}
136136

137137
/// Compile, check and run the exercise's solution.
@@ -142,7 +142,7 @@ pub trait RunnableExercise {
142142
bin_name.push_str(name);
143143
bin_name.push_str("_sol");
144144

145-
self.run(&bin_name, output, cmd_runner)
145+
self.run::<true>(&bin_name, output, cmd_runner)
146146
}
147147
}
148148

0 commit comments

Comments
 (0)