Remove indirection

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2018-11-06 19:03:19 +01:00
parent d493b04555
commit 1a70c523dc

View file

@ -201,9 +201,7 @@ fn create_file<A: AsRef<Path>>(p: A) -> ::std::io::Result<File> {
trace!("'{}' is directory = {}", parent.display(), parent.is_dir()); trace!("'{}' is directory = {}", parent.display(), parent.is_dir());
if !parent.is_dir() { if !parent.is_dir() {
trace!("Implicitely creating directory: {:?}", parent); trace!("Implicitely creating directory: {:?}", parent);
if let Err(e) = create_dir_all(parent) { let _ = create_dir_all(parent)?;
return Err(e);
}
} }
} }
OpenOptions::new().write(true).read(true).create(true).open(p) OpenOptions::new().write(true).read(true).create(true).open(p)