diff options
| author | mo8it <mo8it@proton.me> | 2024-04-24 02:52:30 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-24 02:52:30 +0200 |
| commit | 8a085a0a85c759029cd57c28364867bde817e738 (patch) | |
| tree | b45b6f11597130690232b2eaa9621f25ecf98200 /src/embedded.rs | |
| parent | edf57626129467dacc0c6f04b2ca00e64d5b2245 (diff) | |
Dump solution and show its path
Diffstat (limited to 'src/embedded.rs')
| -rw-r--r-- | src/embedded.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/embedded.rs b/src/embedded.rs index 756b414..d7952a1 100644 --- a/src/embedded.rs +++ b/src/embedded.rs @@ -113,14 +113,12 @@ impl EmbeddedFiles { &self, exercise_ind: usize, dir_name: &str, - exercise_name: &str, + path: &str, ) -> Result<()> { let dir_path = format!("solutions/{dir_name}"); - create_dir_all(&dir_path).context("Failed to create the directory {dir_path}")?; + create_dir_all(&dir_path) + .with_context(|| format!("Failed to create the directory {dir_path}"))?; - WriteStrategy::Overwrite.write( - &format!("{dir_path}/{exercise_name}.rs"), - self.exercise_files[exercise_ind].solution, - ) + WriteStrategy::Overwrite.write(path, self.exercise_files[exercise_ind].solution) } } |
