diff options
| author | marisa <mokou@posteo.de> | 2019-11-11 15:46:32 +0100 |
|---|---|---|
| committer | marisa <mokou@posteo.de> | 2019-11-11 15:46:32 +0100 |
| commit | 627cdc07d07dfe6a740e885e0ddf6900e7ec336b (patch) | |
| tree | 3720932c448d696acee467325fda9bcc1db3b478 /src/exercise.rs | |
| parent | a47a62172a5d4c479d242498b9b140b3111fb7c6 (diff) | |
feat: Index exercises by name
BREAKING CHANGE: This changes the way you use `rustlings run` by now
requiring an abridged form of the previous filename, e.g:
`rustlings run exercises/if/if1.rs` becomes
`rustlings run if1`
Diffstat (limited to 'src/exercise.rs')
| -rw-r--r-- | src/exercise.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/exercise.rs b/src/exercise.rs index 6f526e7..9cd88a0 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -24,6 +24,7 @@ pub struct ExerciseList { #[derive(Deserialize)] pub struct Exercise { + pub name: String, pub path: PathBuf, pub mode: Mode, } @@ -70,6 +71,7 @@ mod test { fn test_clean() { File::create(&temp_file()).unwrap(); let exercise = Exercise { + name: String::from("example"), path: PathBuf::from("example.rs"), mode: Mode::Test, }; |
