Fix path comparison

This commit is contained in:
mo8it 2024-03-31 00:49:19 +01:00
parent b5e17c965d
commit 1e1f031713

View file

@ -97,17 +97,13 @@ impl EmbeddedFiles {
.exercises_dir
.files
.iter()
.find(|file| file.path == path.as_os_str())
.find(|file| Path::new(file.path) == path)
{
return file.write_to_disk(strategy);
}
for dir in self.exercises_dir.dirs {
if let Some(file) = dir
.content
.iter()
.find(|file| file.path == path.as_os_str())
{
if let Some(file) = dir.content.iter().find(|file| Path::new(file.path) == path) {
dir.init_on_disk()?;
return file.write_to_disk(strategy);
}