Use UTF8Error in default hasher impl
This commit is contained in:
parent
70c015f73d
commit
39bb36f023
1 changed files with 2 additions and 2 deletions
|
@ -37,9 +37,9 @@ impl Hasher for DefaultHasher {
|
|||
"default"
|
||||
}
|
||||
|
||||
fn create_hash<R: Read>(&mut self, _: &PathBuf, contents: &mut R) -> Result<String> {
|
||||
fn create_hash<R: Read>(&mut self, _: &PathBuf, c: &mut R) -> Result<String> {
|
||||
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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue