From 144398a2adf94a0ba455c1a25fd3114eb8607bf1 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 28 Nov 2015 16:07:33 +0100 Subject: [PATCH] Remove explanation member of StorageBackendError to reduce complexibility --- src/storage/backend.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/storage/backend.rs b/src/storage/backend.rs index 0bc7d9c5..15035bfb 100644 --- a/src/storage/backend.rs +++ b/src/storage/backend.rs @@ -125,7 +125,7 @@ impl StorageBackend { let mut err = StorageBackendError::build( "File::write_all()", "Could not write out File contents", - "", None + None ); err.caused_by = Some(Box::new(ioerr)); err @@ -135,7 +135,7 @@ impl StorageBackend { let mut err = StorageBackendError::build( "File::create()", "Creating file on disk failed", - "", None + None ); err.caused_by = Some(Box::new(writeerr)); err @@ -164,7 +164,6 @@ impl StorageBackend { debug!("Could not write file"); let mut err = StorageBackendError::build( "File::write()", - "", "Tried to write contents of this file, though operation did not succeed", Some(string) ); @@ -175,7 +174,6 @@ impl StorageBackend { debug!("Could not write file at '{}'", path); let mut err = StorageBackendError::build( "File::open()", - "", "Tried to update contents of this file, though file doesn't exist", None ); @@ -253,7 +251,7 @@ pub struct StorageBackendError { impl StorageBackendError { fn new(action: String, desc : String, - data : Option) -> StorageBackendError<'a> + data : Option) -> StorageBackendError { StorageBackendError { action: action, @@ -265,7 +263,7 @@ impl StorageBackendError { fn build(action: &'static str, desc: &'static str, - data : Option) -> StorageBackendError<'a> + data : Option) -> StorageBackendError { StorageBackendError { action: String::from(action), @@ -304,7 +302,6 @@ fn write_with_parser<'a, HP>(f: &File, p: &Parser) -> Result