mirror of
https://github.com/notohh/rustlings.git
synced 2024-10-30 16:59:12 -04:00
Only take a reference
This commit is contained in:
parent
2566f9aaf6
commit
f04089b8bc
1 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ fn unexpected_file(path: &Path) -> Error {
|
||||||
anyhow!("Found the file `{}`. Only `README.md` and Rust files related to an exercise in `info.toml` are allowed in the `exercises` directory", path.display())
|
anyhow!("Found the file `{}`. Only `README.md` and Rust files related to an exercise in `info.toml` are allowed in the `exercises` directory", path.display())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_exercise_dir_files(info_file_paths: hashbrown::HashSet<PathBuf>) -> Result<()> {
|
fn check_exercise_dir_files(info_file_paths: &hashbrown::HashSet<PathBuf>) -> Result<()> {
|
||||||
for entry in read_dir("exercises").context("Failed to open the `exercises` directory")? {
|
for entry in read_dir("exercises").context("Failed to open the `exercises` directory")? {
|
||||||
let entry = entry.context("Failed to read the `exercises` directory")?;
|
let entry = entry.context("Failed to read the `exercises` directory")?;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ fn check_exercises(info_file: &InfoFile) -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let info_file_paths = check_info_file_exercises(info_file)?;
|
let info_file_paths = check_info_file_exercises(info_file)?;
|
||||||
check_exercise_dir_files(info_file_paths)?;
|
check_exercise_dir_files(&info_file_paths)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue