mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-04 09:13:30 +02:00
Inline reset
This commit is contained in:
+5
-2
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user