Don't write solutions in debug mode

This commit is contained in:
mo8it 2024-04-24 00:48:58 +02:00
parent b77007887c
commit e4ee2cd548

View file

@ -11,7 +11,7 @@ use std::{
process::{Command, Stdio}, process::{Command, Stdio},
}; };
use crate::{embedded::EMBEDDED_FILES, exercise::Exercise, info_file::ExerciseInfo}; use crate::{embedded::EMBEDDED_FILES, exercise::Exercise, info_file::ExerciseInfo, DEBUG_PROFILE};
const STATE_FILE_NAME: &str = ".rustlings-state.txt"; const STATE_FILE_NAME: &str = ".rustlings-state.txt";
const BAD_INDEX_ERR: &str = "The current exercise index is higher than the number of exercises"; const BAD_INDEX_ERR: &str = "The current exercise index is higher than the number of exercises";
@ -264,7 +264,7 @@ impl AppState {
self.n_done += 1; self.n_done += 1;
} }
if self.official_exercises { if self.official_exercises && !DEBUG_PROFILE {
EMBEDDED_FILES.write_solution_to_disk( EMBEDDED_FILES.write_solution_to_disk(
self.current_exercise_ind, self.current_exercise_ind,
exercise exercise