Avoid an unneeded syscall

This commit is contained in:
mo8it 2024-04-18 01:49:32 +02:00
parent 634e17a5ab
commit d64836f317

View File

@ -47,14 +47,12 @@ impl EmbeddedFlatDir {
let path = Path::new(self.path);
if let Err(e) = create_dir(path) {
if !path.is_dir() {
if e.kind() != io::ErrorKind::AlreadyExists {
return Err(e);
}
}
self.readme.write_to_disk(WriteStrategy::Overwrite)?;
Ok(())
self.readme.write_to_disk(WriteStrategy::Overwrite)
}
}