From e80e91faf284a4d20a2a7fd6ecd1c241e5c2e136 Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 13 May 2024 17:12:58 +0200 Subject: [PATCH] Thanks Clippy :) --- src/embedded.rs | 8 ++++---- src/exercise.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/embedded.rs b/src/embedded.rs index 45f8eca..39ade17 100644 --- a/src/embedded.rs +++ b/src/embedded.rs @@ -96,8 +96,8 @@ impl EmbeddedFiles { } pub fn write_exercise_to_disk(&self, exercise_ind: usize, path: &str) -> Result<()> { - let exercise_files = &EMBEDDED_FILES.exercise_files[exercise_ind]; - let dir = &EMBEDDED_FILES.exercise_dirs[exercise_files.dir_ind]; + let exercise_files = &self.exercise_files[exercise_ind]; + let dir = &self.exercise_dirs[exercise_files.dir_ind]; dir.init_on_disk()?; WriteStrategy::Overwrite.write(path, exercise_files.exercise) @@ -109,8 +109,8 @@ impl EmbeddedFiles { exercise_ind: usize, exercise_name: &str, ) -> Result { - let exercise_files = &EMBEDDED_FILES.exercise_files[exercise_ind]; - let dir = &EMBEDDED_FILES.exercise_dirs[exercise_files.dir_ind]; + let exercise_files = &self.exercise_files[exercise_ind]; + let dir = &self.exercise_dirs[exercise_files.dir_ind]; // 14 = 10 + 1 + 3 // solutions/ + / + .rs diff --git a/src/exercise.rs b/src/exercise.rs index 4edf378..6e1b3f0 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -142,7 +142,7 @@ impl From for Exercise { let hint = exercise_info.hint.trim().to_owned(); - Exercise { + Self { dir, name, path,