mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 00:00:03 +03:00
Avoid an unneeded syscall
This commit is contained in:
parent
634e17a5ab
commit
d64836f317
|
@ -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