From 39bb36f023bdc3be053d583ed07539418e9931d2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 11 Aug 2016 13:08:09 +0200 Subject: [PATCH] Use UTF8Error in default hasher impl --- libimagref/src/hasher.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libimagref/src/hasher.rs b/libimagref/src/hasher.rs index b2970837..fcdda5bd 100644 --- a/libimagref/src/hasher.rs +++ b/libimagref/src/hasher.rs @@ -37,9 +37,9 @@ impl Hasher for DefaultHasher { "default" } - fn create_hash(&mut self, _: &PathBuf, contents: &mut R) -> Result { + fn create_hash(&mut self, _: &PathBuf, c: &mut R) -> Result { let mut s = String::new(); - try!(contents.read_to_string(&mut s).map_err_into(REK::IOError)); + try!(c.read_to_string(&mut s).map_err_into(REK::UTF8Error).map_err_into(REK::IOError)); self.hasher.input_str(&s[..]); Ok(self.hasher.result_str()) }