diff --git a/src/embedded.rs b/src/embedded.rs index 866b12b..eae3099 100644 --- a/src/embedded.rs +++ b/src/embedded.rs @@ -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) } }