diff --git a/src/exercise.rs b/src/exercise.rs index 26995295..d8b55d8f 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -55,7 +55,7 @@ pub struct Exercise { // The hint text associated with the exercise pub hint: String, // The path of the next exercise - pub next_path: Option + pub next_path: Option, } // An enum to track of the state of an Exercise. @@ -289,6 +289,7 @@ mod test { path: PathBuf::from("tests/fixture/state/pending_exercise.rs"), mode: Mode::Compile, hint: String::from(""), + next_path: None, }; let compiled = exercise.compile().unwrap(); drop(compiled); @@ -320,6 +321,7 @@ mod test { path: PathBuf::from("tests/fixture/state/pending_exercise.rs"), mode: Mode::Compile, hint: String::new(), + next_path: None, }; let state = exercise.state(); @@ -361,6 +363,7 @@ mod test { path: PathBuf::from("tests/fixture/state/finished_exercise.rs"), mode: Mode::Compile, hint: String::new(), + next_path: None, }; assert_eq!(exercise.state(), State::Done); @@ -373,6 +376,7 @@ mod test { path: PathBuf::from("tests/fixture/success/testSuccess.rs"), mode: Mode::Test, hint: String::new(), + next_path: None, }; let out = exercise.compile().unwrap().run().unwrap(); assert!(out.stdout.contains("THIS TEST TOO SHALL PASS")); diff --git a/src/main.rs b/src/main.rs index 83dbe006..e31488d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -247,9 +247,9 @@ fn main() { } } -fn edit_exercises(exercises: &mut Vec){ +fn edit_exercises(exercises: &mut Vec) { let siz = exercises.len(); - for i in 0.. siz { + for i in 0..siz { if i == siz - 1 { exercises[i].next_path = None; break;