Use sol_path

This commit is contained in:
mo8it
2024-08-28 01:10:19 +02:00
parent 7d2bc1c7a4
commit 5556d42b46
5 changed files with 42 additions and 34 deletions
+3 -7
View File
@@ -321,14 +321,10 @@ impl AppState {
.write_solution_to_disk(self.current_exercise_ind, current_exercise.name)
.map(Some)
} else {
let solution_path = if let Some(dir) = current_exercise.dir {
format!("solutions/{dir}/{}.rs", current_exercise.name)
} else {
format!("solutions/{}.rs", current_exercise.name)
};
let sol_path = current_exercise.sol_path();
if Path::new(&solution_path).exists() {
return Ok(Some(solution_path));
if Path::new(&sol_path).exists() {
return Ok(Some(sol_path));
}
Ok(None)