From c59ed7d2fe973839c525214eb1dce50bfded2dbc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 21 Mar 2016 19:45:09 +0100 Subject: [PATCH] Use unused result when file.write_all() and return error --- libimagstore/src/store.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 011fb7a5..af10869e 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -90,10 +90,11 @@ impl StoreEntry { let file = try!(self.file.create_file()); assert_eq!(self.id, entry.location); - file.write_all(entry.to_str().as_bytes()); + file.write_all(entry.to_str().as_bytes()) + .map_err(|e| StoreError::new(StoreErrorKind::FileError, Some(Box::new(e)))) + } else { + Ok(()) } - - Ok(()) } }