summaryrefslogtreecommitdiff
path: root/src/verify.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-03-31 18:25:54 +0200
committermo8it <mo8it@proton.me>2024-03-31 18:25:54 +0200
commitc1de4d46aad38d315e061b7262f773f48c6aab63 (patch)
treef4dd2c27e9dca918d0ae24391f4f079fda715b30 /src/verify.rs
parent82b563f1654860ba3590d91ec3c0f321e3130ae2 (diff)
Some improvements to error handling
Diffstat (limited to 'src/verify.rs')
-rw-r--r--src/verify.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/verify.rs b/src/verify.rs
index 56c6779..adfd3b2 100644
--- a/src/verify.rs
+++ b/src/verify.rs
@@ -79,7 +79,7 @@ fn compile_only(exercise: &Exercise, success_hints: bool) -> Result<bool> {
let _ = exercise.run()?;
progress_bar.finish_and_clear();
- Ok(prompt_for_completion(exercise, None, success_hints))
+ prompt_for_completion(exercise, None, success_hints)
}
// Compile the given Exercise and run the resulting binary in an interactive mode
@@ -102,7 +102,7 @@ fn compile_and_run_interactively(exercise: &Exercise, success_hints: bool) -> Re
bail!("TODO");
}
- Ok(prompt_for_completion(exercise, Some(output), success_hints))
+ prompt_for_completion(exercise, Some(output), success_hints)
}
// Compile the given Exercise as a test harness and display
@@ -139,7 +139,7 @@ fn compile_and_test(
}
if run_mode == RunMode::Interactive {
- Ok(prompt_for_completion(exercise, None, success_hints))
+ prompt_for_completion(exercise, None, success_hints)
} else {
Ok(true)
}
@@ -149,9 +149,9 @@ fn prompt_for_completion(
exercise: &Exercise,
prompt_output: Option<Output>,
success_hints: bool,
-) -> bool {
- let context = match exercise.state() {
- State::Done => return true,
+) -> Result<bool> {
+ let context = match exercise.state()? {
+ State::Done => return Ok(true),
State::Pending(context) => context,
};
match exercise.mode {
@@ -215,7 +215,7 @@ fn prompt_for_completion(
);
}
- false
+ Ok(false)
}
fn separator() -> console::StyledObject<&'static str> {