Skip to content

Commit a610fc1

Browse files
committed
Remove unneeded closure
1 parent e890285 commit a610fc1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,14 @@ fn watch(
335335

336336
clear_screen();
337337

338-
let to_owned_hint = |t: &Exercise| t.hint.to_owned();
339338
let failed_exercise_hint = match verify(
340339
exercises.iter(),
341340
(0, exercises.len()),
342341
verbose,
343342
success_hints,
344343
) {
345344
Ok(_) => return Ok(WatchStatus::Finished),
346-
Err(exercise) => Arc::new(Mutex::new(Some(to_owned_hint(exercise)))),
345+
Err(exercise) => Arc::new(Mutex::new(Some(exercise.hint.clone()))),
347346
};
348347
spawn_watch_shell(&failed_exercise_hint, Arc::clone(&should_quit));
349348
loop {
@@ -380,7 +379,7 @@ fn watch(
380379
Err(exercise) => {
381380
let mut failed_exercise_hint =
382381
failed_exercise_hint.lock().unwrap();
383-
*failed_exercise_hint = Some(to_owned_hint(exercise));
382+
*failed_exercise_hint = Some(exercise.hint.clone());
384383
}
385384
}
386385
}

0 commit comments

Comments
 (0)