mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Fix path comparison
This commit is contained in:
parent
b5e17c965d
commit
1e1f031713
1 changed files with 2 additions and 6 deletions
|
@ -97,17 +97,13 @@ impl EmbeddedFiles {
|
||||||
.exercises_dir
|
.exercises_dir
|
||||||
.files
|
.files
|
||||||
.iter()
|
.iter()
|
||||||
.find(|file| file.path == path.as_os_str())
|
.find(|file| Path::new(file.path) == path)
|
||||||
{
|
{
|
||||||
return file.write_to_disk(strategy);
|
return file.write_to_disk(strategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
for dir in self.exercises_dir.dirs {
|
for dir in self.exercises_dir.dirs {
|
||||||
if let Some(file) = dir
|
if let Some(file) = dir.content.iter().find(|file| Path::new(file.path) == path) {
|
||||||
.content
|
|
||||||
.iter()
|
|
||||||
.find(|file| file.path == path.as_os_str())
|
|
||||||
{
|
|
||||||
dir.init_on_disk()?;
|
dir.init_on_disk()?;
|
||||||
return file.write_to_disk(strategy);
|
return file.write_to_disk(strategy);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue