From bdf4960b6a9626c83281ae2fb9cbccda676dffcf Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 7 Aug 2024 23:25:22 +0200 Subject: [PATCH] Fix exercise name shift in exercise check --- src/dev/check.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/dev/check.rs b/src/dev/check.rs index e1e716c..202e629 100644 --- a/src/dev/check.rs +++ b/src/dev/check.rs @@ -175,22 +175,21 @@ fn check_exercises_unsolved(info_file: &InfoFile, cmd_runner: &CmdRunner) -> Res return None; } - Some(s.spawn(|| exercise_info.run_exercise(None, cmd_runner))) + Some(( + exercise_info.name.as_str(), + s.spawn(|| exercise_info.run_exercise(None, cmd_runner)), + )) }) .collect::>(); - for (exercise_info, handle) in info_file.exercises.iter().zip(handles) { + for (exercise_name, handle) in handles { let Ok(result) = handle.join() else { - bail!( - "Panic while trying to run the exericse {}", - exercise_info.name, - ); + bail!("Panic while trying to run the exericse {exercise_name}"); }; match result { Ok(true) => bail!( - "The exercise {} is already solved.\n{SKIP_CHECK_UNSOLVED_HINT}", - exercise_info.name, + "The exercise {exercise_name} is already solved.\n{SKIP_CHECK_UNSOLVED_HINT}", ), Ok(false) => (), Err(e) => return Err(e),