mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-25 00:00:05 +03:00
Remove the tracking of done and pending
This commit is contained in:
parent
8cac21511c
commit
9705c161b4
|
@ -417,8 +417,6 @@ impl AppState {
|
||||||
clear_terminal(stdout)?;
|
clear_terminal(stdout)?;
|
||||||
|
|
||||||
let mut progresses = vec![ExerciseCheckProgress::None; self.exercises.len()];
|
let mut progresses = vec![ExerciseCheckProgress::None; self.exercises.len()];
|
||||||
let mut done = 0;
|
|
||||||
let mut pending = 0;
|
|
||||||
|
|
||||||
thread::scope(|s| {
|
thread::scope(|s| {
|
||||||
let (exercise_progress_sender, exercise_progress_receiver) = mpsc::channel();
|
let (exercise_progress_sender, exercise_progress_receiver) = mpsc::channel();
|
||||||
|
@ -468,13 +466,6 @@ impl AppState {
|
||||||
|
|
||||||
while let Ok((exercise_ind, progress)) = exercise_progress_receiver.recv() {
|
while let Ok((exercise_ind, progress)) = exercise_progress_receiver.recv() {
|
||||||
progresses[exercise_ind] = progress;
|
progresses[exercise_ind] = progress;
|
||||||
|
|
||||||
match progress {
|
|
||||||
ExerciseCheckProgress::None | ExerciseCheckProgress::Checking => (),
|
|
||||||
ExerciseCheckProgress::Done => done += 1,
|
|
||||||
ExerciseCheckProgress::Pending => pending += 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
show_exercises_check_progress(stdout, &progresses, term_width)?;
|
show_exercises_check_progress(stdout, &progresses, term_width)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,10 +494,8 @@ impl AppState {
|
||||||
let exercise = &self.exercises[exercise_ind];
|
let exercise = &self.exercises[exercise_ind];
|
||||||
let success = exercise.run_exercise(None, &self.cmd_runner)?;
|
let success = exercise.run_exercise(None, &self.cmd_runner)?;
|
||||||
if success {
|
if success {
|
||||||
done += 1;
|
|
||||||
progresses[exercise_ind] = ExerciseCheckProgress::Done;
|
progresses[exercise_ind] = ExerciseCheckProgress::Done;
|
||||||
} else {
|
} else {
|
||||||
pending += 1;
|
|
||||||
if first_pending_exercise_ind.is_none() {
|
if first_pending_exercise_ind.is_none() {
|
||||||
first_pending_exercise_ind = Some(exercise_ind);
|
first_pending_exercise_ind = Some(exercise_ind);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue