@@ -72,7 +72,7 @@ pub trait RunnableExercise {
72
72
73
73
// Compile, check and run the exercise or its solution (depending on `bin_name´).
74
74
// The output is written to the `output` buffer after clearing it.
75
- fn run (
75
+ fn run < const FORCE_STRICT_CLIPPY : bool > (
76
76
& self ,
77
77
bin_name : & str ,
78
78
mut output : Option < & mut Vec < u8 > > ,
@@ -115,7 +115,7 @@ pub trait RunnableExercise {
115
115
let mut clippy_cmd = cmd_runner. cargo ( "clippy" , bin_name, output. as_deref_mut ( ) ) ;
116
116
117
117
// `--profile test` is required to also check code with `[cfg(test)]`.
118
- if self . strict_clippy ( ) {
118
+ if FORCE_STRICT_CLIPPY || self . strict_clippy ( ) {
119
119
clippy_cmd. args ( [ "--profile" , "test" , "--" , "-D" , "warnings" ] ) ;
120
120
} else {
121
121
clippy_cmd. args ( [ "--profile" , "test" ] ) ;
@@ -131,7 +131,7 @@ pub trait RunnableExercise {
131
131
/// The output is written to the `output` buffer after clearing it.
132
132
#[ inline]
133
133
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)
135
135
}
136
136
137
137
/// Compile, check and run the exercise's solution.
@@ -142,7 +142,7 @@ pub trait RunnableExercise {
142
142
bin_name. push_str ( name) ;
143
143
bin_name. push_str ( "_sol" ) ;
144
144
145
- self . run ( & bin_name, output, cmd_runner)
145
+ self . run :: < true > ( & bin_name, output, cmd_runner)
146
146
}
147
147
}
148
148
0 commit comments