diff --git a/src/file.rs b/src/file.rs index 0ad246c..8326d13 100644 --- a/src/file.rs +++ b/src/file.rs @@ -138,7 +138,10 @@ impl <'a, 'b> File<'a, 'b> { impl<'a, 'b> Drop for File<'a, 'b> { fn drop(&mut self) { - self.flush().expect("flush failed"); + match self.flush() { + Err(err) => error!("flush failed {}", err), + _ => {}, + } } } diff --git a/src/utils.rs b/src/utils.rs index 3c4d107..7e56902 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -130,6 +130,9 @@ impl Seek for BufStream { impl Drop for BufStream { fn drop(&mut self) { - self.flush().expect("flush failed!"); + match self.flush() { + Err(err) => error!("flush failed {}", err), + _ => {}, + } } }