diff --git a/src/run.rs b/src/run.rs index 1e2e56cf..123b03c7 100644 --- a/src/run.rs +++ b/src/run.rs @@ -1,7 +1,7 @@ use std::process::Command; use crate::exercise::{Exercise, Mode}; -use crate::verify::test; +use crate::verify::{test, compile_only}; use indicatif::ProgressBar; // Invoke the rust compiler on the path of the given exercise, @@ -12,7 +12,10 @@ pub fn run(exercise: &Exercise, verbose: bool) -> Result<(), ()> { match exercise.mode { Mode::Test => test(exercise, verbose)?, Mode::Compile => compile_and_run(exercise)?, - Mode::Clippy => compile_and_run(exercise)?, + Mode::Clippy => match compile_only(exercise).unwrap() { + true => return Err(()), + false => return Ok(()), + }, } Ok(()) } diff --git a/src/verify.rs b/src/verify.rs index 97471b8f..6435bb18 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -48,7 +48,7 @@ pub fn test(exercise: &Exercise, verbose: bool) -> Result<(), ()> { } // Invoke the rust compiler without running the resulting binary -fn compile_only(exercise: &Exercise) -> Result { +pub fn compile_only(exercise: &Exercise) -> Result { let progress_bar = ProgressBar::new_spinner(); progress_bar.set_message(format!("Compiling {exercise}...")); progress_bar.enable_steady_tick(100);