From 74fab994e2133cc40718abe923645922785c2a57 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 28 Jul 2024 20:30:23 +0200 Subject: Make the output optional --- src/dev/check.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/dev/check.rs') diff --git a/src/dev/check.rs b/src/dev/check.rs index 5c35462..2090dab 100644 --- a/src/dev/check.rs +++ b/src/dev/check.rs @@ -184,8 +184,7 @@ fn check_exercises_unsolved(info_file: &InfoFile, target_dir: &Path) -> Result<( error_occurred.store(true, atomic::Ordering::Relaxed); }; - let mut output = Vec::with_capacity(OUTPUT_CAPACITY); - match exercise_info.run_exercise(&mut output, target_dir) { + match exercise_info.run_exercise(None, target_dir) { Ok(true) => error(b"Already solved!"), Ok(false) => (), Err(e) => error(e.to_string().as_bytes()), @@ -244,7 +243,7 @@ fn check_solutions(require_solutions: bool, info_file: &InfoFile, target_dir: &P } let mut output = Vec::with_capacity(OUTPUT_CAPACITY); - match exercise_info.run_solution(&mut output, target_dir) { + match exercise_info.run_solution(Some(&mut output), target_dir) { Ok(true) => { paths.lock().unwrap().insert(PathBuf::from(path)); } -- cgit v1.2.3