diff options
| author | mo8it <mo8it@proton.me> | 2024-03-31 20:08:23 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-03-31 20:08:23 +0200 |
| commit | 7560aec66b4a109c32ea59daa65580ab2ac26333 (patch) | |
| tree | 5426916831771b19eab31fe9a14026ed1b27f26b /src/main.rs | |
| parent | fb32d0b86fd2f3f0c1e82fecbf2cf4931a7b1ff5 (diff) | |
Inline reset
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 72bff4d..0f298dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ +use crate::embedded::{WriteStrategy, EMBEDDED_FILES}; use crate::exercise::{Exercise, ExerciseList}; -use crate::run::{reset, run}; +use crate::run::run; use crate::verify::verify; use anyhow::{Context, Result}; use clap::{Parser, Subcommand}; @@ -207,7 +208,9 @@ If you are just starting with Rustlings, run the command `rustlings init` to ini Subcommands::Reset { name } => { let exercise = find_exercise(&name, &exercises)?; - reset(exercise)?; + EMBEDDED_FILES + .write_exercise_to_disk(&exercise.path, WriteStrategy::Overwrite) + .with_context(|| format!("Failed to reset the exercise {exercise}"))?; println!("The file {} has been reset!", exercise.path.display()); } |
