mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 07:46:29 +00: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);
|
let path = Path::new(self.path);
|
||||||
|
|
||||||
if let Err(e) = create_dir(path) {
|
if let Err(e) = create_dir(path) {
|
||||||
if !path.is_dir() {
|
if e.kind() != io::ErrorKind::AlreadyExists {
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.readme.write_to_disk(WriteStrategy::Overwrite)?;
|
self.readme.write_to_disk(WriteStrategy::Overwrite)
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue