From c02e6580bea90055ca6b9725e182f3bb0daf7f37 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:50:30 +0200 Subject: [PATCH] [Auto] lib/entry/ref: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- lib/entry/libimagentryref/src/reference.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/entry/libimagentryref/src/reference.rs b/lib/entry/libimagentryref/src/reference.rs index f4dde962..029c38e5 100644 --- a/lib/entry/libimagentryref/src/reference.rs +++ b/lib/entry/libimagentryref/src/reference.rs @@ -246,7 +246,7 @@ impl<'a, H: Hasher> Ref for RefWithHasher<'a, H> { .ok_or_else(|| Error::from(EM::EntryHeaderTypeError2("ref.hash.", "string")))?; - let file_path = get_file_path(config, basepath_name.as_ref(), &path)?; + let file_path = get_file_path(config, basepath_name, &path)?; ref_header .read(H::NAME) @@ -332,18 +332,18 @@ impl<'a, H> MutRef for MutRefWithHasher<'a, H> if self.0.get_header().read("ref.is_ref")?.is_some() && !force { debug!("Entry is already a Ref!"); - let _ = Err(err_msg("Entry is already a reference")).context("Making ref out of entry")?; + Err(err_msg("Entry is already a reference")).context("Making ref out of entry")?; } let file_path = get_file_path(config, basepath_name.as_ref(), &path)?; if !file_path.exists() { let msg = format_err!("File '{:?}' does not exist", file_path); - let _ = Err(msg).context("Making ref out of entry")?; + Err(msg).context("Making ref out of entry")?; } debug!("Entry hashing = {}", file_path.display()); - let _ = H::hash(&file_path) + H::hash(&file_path) .and_then(|hash| { trace!("hash = {}", hash); @@ -391,7 +391,7 @@ pub(crate) fn make_header_section(hash: String, hashname: H, relpath: P .map(String::from) .ok_or_else(|| { let msg = format_err!("UTF Error in '{:?}'", relpath.as_ref()); - Error::from(msg) + msg })?; let _ = header_section.insert("relpath", Value::String(relpath))?; @@ -460,7 +460,7 @@ mod test { path.as_ref() .to_str() .map(String::from) - .ok_or_else(|| Error::from(err_msg("Failed to create test hash"))) + .ok_or_else(|| err_msg("Failed to create test hash")) } }