diff options
| author | mo8it <mo8it@proton.me> | 2024-09-04 02:19:45 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-09-04 02:19:45 +0200 |
| commit | 247bd19f93e11fb037c945ff1dc464a1d1713471 (patch) | |
| tree | 7b9b404b2c0c157f3d50bf26288a441be13aae52 /src/run.rs | |
| parent | e5ed11528855f6dddc5759df3426ff1296aba87e (diff) | |
Canonicalize exercise paths only once
Diffstat (limited to 'src/run.rs')
| -rw-r--r-- | src/run.rs | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -11,7 +11,6 @@ use std::{ use crate::{ app_state::{AppState, ExercisesProgress}, exercise::{solution_link_line, RunnableExercise, OUTPUT_CAPACITY}, - term::terminal_file_link, }; pub fn run(app_state: &mut AppState) -> Result<()> { @@ -26,7 +25,9 @@ pub fn run(app_state: &mut AppState) -> Result<()> { app_state.set_pending(app_state.current_exercise_ind())?; stdout.write_all(b"Ran ")?; - terminal_file_link(&mut stdout, app_state.current_exercise().path, Color::Blue)?; + app_state + .current_exercise() + .terminal_file_link(&mut stdout)?; stdout.write_all(b" with errors\n")?; exit(1); } @@ -46,7 +47,9 @@ pub fn run(app_state: &mut AppState) -> Result<()> { match app_state.done_current_exercise(&mut stdout)? { ExercisesProgress::CurrentPending | ExercisesProgress::NewPending => { stdout.write_all(b"Next exercise: ")?; - terminal_file_link(&mut stdout, app_state.current_exercise().path, Color::Blue)?; + app_state + .current_exercise() + .terminal_file_link(&mut stdout)?; stdout.write_all(b"\n")?; } ExercisesProgress::AllDone => (), |
