@@ -381,7 +381,7 @@ impl AppState {
381381
382382 // Return the exercise index of the first pending exercise found.
383383 fn check_all_exercises ( & self , stdout : & mut StdoutLock ) -> Result < Option < usize > > {
384- stdout. write_all ( RERUNNING_ALL_EXERCISES_MSG ) ?;
384+ stdout. write_all ( FINAL_CHECK_MSG ) ?;
385385 let n_exercises = self . exercises . len ( ) ;
386386
387387 let status = thread:: scope ( |s| {
@@ -441,7 +441,10 @@ impl AppState {
441441 /// Mark the current exercise as done and move on to the next pending exercise if one exists.
442442 /// If all exercises are marked as done, run all of them to make sure that they are actually
443443 /// done. If an exercise which is marked as done fails, mark it as pending and continue on it.
444- pub fn done_current_exercise ( & mut self , stdout : & mut StdoutLock ) -> Result < ExercisesProgress > {
444+ pub fn done_current_exercise < const CLEAR_BEFORE_FINAL_CHECK : bool > (
445+ & mut self ,
446+ stdout : & mut StdoutLock ,
447+ ) -> Result < ExercisesProgress > {
445448 let exercise = & mut self . exercises [ self . current_exercise_ind ] ;
446449 if !exercise. done {
447450 exercise. done = true ;
@@ -453,6 +456,12 @@ impl AppState {
453456 return Ok ( ExercisesProgress :: NewPending ) ;
454457 }
455458
459+ if CLEAR_BEFORE_FINAL_CHECK {
460+ clear_terminal ( stdout) ?;
461+ } else {
462+ stdout. write_all ( b"\n " ) ?;
463+ }
464+
456465 if let Some ( pending_exercise_ind) = self . check_all_exercises ( stdout) ? {
457466 stdout. write_all ( b"\n \n " ) ?;
458467
@@ -482,8 +491,7 @@ impl AppState {
482491
483492const BAD_INDEX_ERR : & str = "The current exercise index is higher than the number of exercises" ;
484493const STATE_FILE_HEADER : & [ u8 ] = b"DON'T EDIT THIS FILE!\n \n " ;
485- const RERUNNING_ALL_EXERCISES_MSG : & [ u8 ] = b"
486- All exercises seem to be done.
494+ const FINAL_CHECK_MSG : & [ u8 ] = b"All exercises seem to be done.
487495Recompiling and running all exercises to make sure that all of them are actually done.
488496" ;
489497const FENISH_LINE : & str = "+----------------------------------------------------+
0 commit comments