summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-18 12:41:17 +0200
committermo8it <mo8it@proton.me>2024-04-18 12:41:17 +0200
commit01e6732e4d920d9a1859e05fa28382e4307571af (patch)
tree122060cdc0ef3f81d367e0afc7b0e3e9d29d33ee /src/main.rs
parentf04089b8bc724d41dcd26117c85f32328b5eb597 (diff)
Improve resetting
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index c8940af..0469737 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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)?;