From 4d11ad2ac130c2c94d620392a26579d98c9f6880 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:41:35 +0200 Subject: [PATCH] [Auto] bin/core/store: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- bin/core/imag-store/src/create.rs | 4 ++-- bin/core/imag-store/src/delete.rs | 2 +- bin/core/imag-store/src/get.rs | 4 ++-- bin/core/imag-store/src/retrieve.rs | 8 ++++---- bin/core/imag-store/src/update.rs | 2 +- bin/core/imag-store/src/util.rs | 2 +- bin/core/imag-store/src/verify.rs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/core/imag-store/src/create.rs b/bin/core/imag-store/src/create.rs index dcb5c686..0384310f 100644 --- a/bin/core/imag-store/src/create.rs +++ b/bin/core/imag-store/src/create.rs @@ -63,7 +63,7 @@ pub fn create(rt: &Runtime) { } .map_err_trace_exit_unwrap(); - let _ = rt.report_touched(&path).unwrap_or_exit(); + rt.report_touched(&path).unwrap_or_exit(); } fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> Result<()> { @@ -84,7 +84,7 @@ fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> R debug!("Got content with len = {}", content.len()); let header = matches.subcommand_matches("entry") - .map_or_else(|| Entry::default_header(), + .map_or_else(Entry::default_header, |entry_matches| build_toml_header(entry_matches, Entry::default_header())); create_with_content_and_header(rt, path, content, header) diff --git a/bin/core/imag-store/src/delete.rs b/bin/core/imag-store/src/delete.rs index c3a9a052..b6189414 100644 --- a/bin/core/imag-store/src/delete.rs +++ b/bin/core/imag-store/src/delete.rs @@ -31,7 +31,7 @@ pub fn delete(rt: &Runtime) { let path = StoreId::new(path).map_err_trace_exit_unwrap(); debug!("Deleting file at {:?}", id); - let _ = rt.store() + rt.store() .delete(path) .map_warn_err(|e| format!("Error: {:?}", e)) .map_err_trace_exit_unwrap(); diff --git a/bin/core/imag-store/src/get.rs b/bin/core/imag-store/src/get.rs index 6885f594..21115398 100644 --- a/bin/core/imag-store/src/get.rs +++ b/bin/core/imag-store/src/get.rs @@ -34,10 +34,10 @@ pub fn get(rt: &Runtime) { let path = StoreId::new(path).map_err_trace_exit_unwrap(); debug!("path = {:?}", path); - let _ = match rt.store().get(path.clone()).map_err_trace_exit_unwrap() { + match rt.store().get(path.clone()).map_err_trace_exit_unwrap() { Some(entry) => { print_entry(rt, scmd, entry); - let _ = rt.report_touched(&path).unwrap_or_exit(); + rt.report_touched(&path).unwrap_or_exit(); }, None => info!("No entry found"), }; diff --git a/bin/core/imag-store/src/retrieve.rs b/bin/core/imag-store/src/retrieve.rs index b359a3c4..06a0612f 100644 --- a/bin/core/imag-store/src/retrieve.rs +++ b/bin/core/imag-store/src/retrieve.rs @@ -47,14 +47,14 @@ pub fn retrieve(rt: &Runtime) { .map_dbg(|e| format!("{:?}", e)) .map_err_trace_exit_unwrap(); - let _ = rt.report_touched(&path).unwrap_or_exit(); + rt.report_touched(&path).unwrap_or_exit(); }); } pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) { if do_print_raw(scmd) { debug!("Printing raw content..."); - let _ = writeln!(rt.stdout(), "{}", e.to_str().map_err_trace_exit_unwrap()) + writeln!(rt.stdout(), "{}", e.to_str().map_err_trace_exit_unwrap()) .to_exit_code() .unwrap_or_exit(); } else if do_filter(scmd) { @@ -73,7 +73,7 @@ pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) { unimplemented!() } else { debug!("Printing header as TOML..."); - let _ = writeln!(rt.stdout(), "{}", e.get_header()) + writeln!(rt.stdout(), "{}", e.get_header()) .to_exit_code() .unwrap_or_exit(); } @@ -81,7 +81,7 @@ pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) { if do_print_content(scmd) { debug!("Printing content..."); - let _ = writeln!(rt.stdout(), "{}", e.get_content()) + writeln!(rt.stdout(), "{}", e.get_content()) .to_exit_code() .unwrap_or_exit(); } diff --git a/bin/core/imag-store/src/update.rs b/bin/core/imag-store/src/update.rs index 4ce5ac44..595b7b13 100644 --- a/bin/core/imag-store/src/update.rs +++ b/bin/core/imag-store/src/update.rs @@ -49,7 +49,7 @@ pub fn update(rt: &Runtime) { debug!("New header set"); } - let _ = rt.report_touched(locked_e.get_location()).unwrap_or_exit(); + rt.report_touched(locked_e.get_location()).unwrap_or_exit(); }); } diff --git a/bin/core/imag-store/src/util.rs b/bin/core/imag-store/src/util.rs index 62f19120..c1dcc8d3 100644 --- a/bin/core/imag-store/src/util.rs +++ b/bin/core/imag-store/src/util.rs @@ -29,7 +29,7 @@ use libimagutil::key_value_split::IntoKeyValue; pub fn build_toml_header(matches: &ArgMatches, mut header: Value) -> Value { debug!("Building header from cli spec"); if let Some(headerspecs) = matches.values_of("header") { - let kvs = headerspecs.into_iter() + let kvs = headerspecs .filter_map(|hs| { debug!("- Processing: '{}'", hs); let kv = String::from(hs).into_kv(); diff --git a/bin/core/imag-store/src/verify.rs b/bin/core/imag-store/src/verify.rs index c63b7c41..a43ad908 100644 --- a/bin/core/imag-store/src/verify.rs +++ b/bin/core/imag-store/src/verify.rs @@ -48,7 +48,7 @@ pub fn verify(rt: &Runtime) { }; info!("{: >6} | {: >14} | {:?}", verify, content_len, p.deref()); - let _ = rt.report_touched(fle.get_location()).unwrap_or_exit(); + rt.report_touched(fle.get_location()).unwrap_or_exit(); status });