mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Thanks Clippy :)
This commit is contained in:
parent
4ae3fcc3ca
commit
e80e91faf2
2 changed files with 5 additions and 5 deletions
|
@ -96,8 +96,8 @@ impl EmbeddedFiles {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_exercise_to_disk(&self, exercise_ind: usize, path: &str) -> Result<()> {
|
pub fn write_exercise_to_disk(&self, exercise_ind: usize, path: &str) -> Result<()> {
|
||||||
let exercise_files = &EMBEDDED_FILES.exercise_files[exercise_ind];
|
let exercise_files = &self.exercise_files[exercise_ind];
|
||||||
let dir = &EMBEDDED_FILES.exercise_dirs[exercise_files.dir_ind];
|
let dir = &self.exercise_dirs[exercise_files.dir_ind];
|
||||||
|
|
||||||
dir.init_on_disk()?;
|
dir.init_on_disk()?;
|
||||||
WriteStrategy::Overwrite.write(path, exercise_files.exercise)
|
WriteStrategy::Overwrite.write(path, exercise_files.exercise)
|
||||||
|
@ -109,8 +109,8 @@ impl EmbeddedFiles {
|
||||||
exercise_ind: usize,
|
exercise_ind: usize,
|
||||||
exercise_name: &str,
|
exercise_name: &str,
|
||||||
) -> Result<String> {
|
) -> Result<String> {
|
||||||
let exercise_files = &EMBEDDED_FILES.exercise_files[exercise_ind];
|
let exercise_files = &self.exercise_files[exercise_ind];
|
||||||
let dir = &EMBEDDED_FILES.exercise_dirs[exercise_files.dir_ind];
|
let dir = &self.exercise_dirs[exercise_files.dir_ind];
|
||||||
|
|
||||||
// 14 = 10 + 1 + 3
|
// 14 = 10 + 1 + 3
|
||||||
// solutions/ + / + .rs
|
// solutions/ + / + .rs
|
||||||
|
|
|
@ -142,7 +142,7 @@ impl From<ExerciseInfo> for Exercise {
|
||||||
|
|
||||||
let hint = exercise_info.hint.trim().to_owned();
|
let hint = exercise_info.hint.trim().to_owned();
|
||||||
|
|
||||||
Exercise {
|
Self {
|
||||||
dir,
|
dir,
|
||||||
name,
|
name,
|
||||||
path,
|
path,
|
||||||
|
|
Loading…
Reference in a new issue