Skip to content

Commit 8854f0a

Browse files
committed
Use anyhow!
1 parent 13cc3ac commit 8854f0a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/dev/check.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ fn check_exercises(info_file: &InfoFile, cmd_runner: &CmdRunner) -> Result<()> {
229229

230230
enum SolutionCheck {
231231
Success { sol_path: String },
232-
MissingRequired,
233232
MissingOptional,
234233
RunFailure { output: Vec<u8> },
235234
Err(Error),
@@ -252,7 +251,10 @@ fn check_solutions(
252251
let sol_path = exercise_info.sol_path();
253252
if !Path::new(&sol_path).exists() {
254253
if require_solutions {
255-
return SolutionCheck::MissingRequired;
254+
return SolutionCheck::Err(anyhow!(
255+
"The solution of the exercise {} is missing",
256+
exercise_info.name,
257+
));
256258
}
257259

258260
return SolutionCheck::MissingOptional;
@@ -296,12 +298,6 @@ fn check_solutions(
296298
fmt_cmd.arg(&sol_path);
297299
sol_paths.insert(PathBuf::from(sol_path));
298300
}
299-
SolutionCheck::MissingRequired => {
300-
bail!(
301-
"The solution of the exercise {} is missing",
302-
exercise_info.name,
303-
);
304-
}
305301
SolutionCheck::MissingOptional => (),
306302
SolutionCheck::RunFailure { output } => {
307303
stdout.write_all(b"\n\n")?;

0 commit comments

Comments
 (0)