mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-24 19:58:08 -05:00
Avoid an unneeded syscall
This commit is contained in:
parent
634e17a5ab
commit
d64836f317
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue