mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-24 22:47:32 -05:00
Remove unneeded closure
This commit is contained in:
parent
e89028581c
commit
a610fc1bc2
1 changed files with 2 additions and 3 deletions
|
@ -335,7 +335,6 @@ fn watch(
|
|||
|
||||
clear_screen();
|
||||
|
||||
let to_owned_hint = |t: &Exercise| t.hint.to_owned();
|
||||
let failed_exercise_hint = match verify(
|
||||
exercises.iter(),
|
||||
(0, exercises.len()),
|
||||
|
@ -343,7 +342,7 @@ fn watch(
|
|||
success_hints,
|
||||
) {
|
||||
Ok(_) => return Ok(WatchStatus::Finished),
|
||||
Err(exercise) => Arc::new(Mutex::new(Some(to_owned_hint(exercise)))),
|
||||
Err(exercise) => Arc::new(Mutex::new(Some(exercise.hint.clone()))),
|
||||
};
|
||||
spawn_watch_shell(&failed_exercise_hint, Arc::clone(&should_quit));
|
||||
loop {
|
||||
|
@ -380,7 +379,7 @@ fn watch(
|
|||
Err(exercise) => {
|
||||
let mut failed_exercise_hint =
|
||||
failed_exercise_hint.lock().unwrap();
|
||||
*failed_exercise_hint = Some(to_owned_hint(exercise));
|
||||
*failed_exercise_hint = Some(exercise.hint.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue