Improve resetting

This commit is contained in:
mo8it
2024-04-18 12:41:17 +02:00
parent f04089b8bc
commit 01e6732e4d
4 changed files with 67 additions and 47 deletions
+2 -4
View File
@@ -158,10 +158,8 @@ fn main() -> Result<()> {
}
Some(Subcommands::Reset { name }) => {
app_state.set_current_exercise_by_name(&name)?;
let exercise = app_state.current_exercise();
exercise.reset()?;
println!("The exercise {exercise} has been reset!");
app_state.set_pending(app_state.current_exercise_ind())?;
let exercise_path = app_state.reset_current_exercise()?;
println!("The exercise {exercise_path} has been reset");
}
Some(Subcommands::Hint { name }) => {
app_state.set_current_exercise_by_name(&name)?;