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`
This commit is contained in:
marisa
2019-11-11 15:46:32 +01:00
parent a47a62172a
commit 627cdc07d0
6 changed files with 68 additions and 15 deletions

View File

@@ -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,
};