From 1a70c523dc43230c535694fa7bf247e5858ab5cf Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 6 Nov 2018 19:03:19 +0100 Subject: [PATCH] Remove indirection Signed-off-by: Matthias Beyer --- lib/core/libimagstore/src/file_abstraction/fs.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs index d6d829c2..fe1407e3 100644 --- a/lib/core/libimagstore/src/file_abstraction/fs.rs +++ b/lib/core/libimagstore/src/file_abstraction/fs.rs @@ -201,9 +201,7 @@ fn create_file>(p: A) -> ::std::io::Result { trace!("'{}' is directory = {}", parent.display(), parent.is_dir()); if !parent.is_dir() { trace!("Implicitely creating directory: {:?}", parent); - if let Err(e) = create_dir_all(parent) { - return Err(e); - } + let _ = create_dir_all(parent)?; } } OpenOptions::new().write(true).read(true).create(true).open(p)