Keep exercise path owned

This commit is contained in:
mo8it
2026-02-26 16:10:09 +01:00
parent 0cbcb8964c
commit 2512701e2f
4 changed files with 12 additions and 18 deletions
+3 -3
View File
@@ -69,7 +69,7 @@ pub struct Exercise {
pub dir: Option<&'static str>,
pub name: &'static str,
/// Path of the exercise file starting with the `exercises/` directory.
pub path: &'static str,
pub path: String,
pub canonical_path: Option<String>,
pub test: bool,
pub strict_clippy: bool,
@@ -85,9 +85,9 @@ impl Exercise {
) -> io::Result<()> {
file_path(writer, Color::Blue, |writer| {
if emit_file_links && let Some(canonical_path) = self.canonical_path.as_deref() {
terminal_file_link(writer, self.path, canonical_path)
terminal_file_link(writer, &self.path, canonical_path)
} else {
writer.write_str(self.path)
writer.write_str(&self.path)
}
})
}