From 219eb844ee47554bda930bbfb6945e336d048d32 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:37:35 -0500 Subject: [PATCH] chore: apply clippy suggestions warning: immediately dereferencing a reference --> src/util.rs:1995:54 | 1995 | match simd_json::serde::from_slice(&mut **&mut s_slice) { | ^^^^^^^^^^^^^ help: try: `s_slice` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof = note: `#[warn(clippy::deref_addrof)]` on by default warning: immediately dereferencing a reference --> src/util.rs:2139:54 | 2139 | match simd_json::serde::from_slice(&mut **&mut s_slice) { | ^^^^^^^^^^^^^ help: try: `s_slice` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof warning: deref which would be done by auto-deref --> src/util.rs:1995:48 | 1995 | match simd_json::serde::from_slice(&mut **&mut s_slice) { | ^^^^^^^^^^^^^^^^^^^ help: try: `&mut s_slice` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref = note: `#[warn(clippy::explicit_auto_deref)]` on by default warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/util.rs:2126:63 | 2126 | csv_to_jsonl(&tempfile_path, &get_stats_data_types(), &statsdatajson_path)?; | ^^^^^^^^^^^^^^^^^^^ help: change this to: `statsdatajson_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default warning: deref which would be done by auto-deref --> src/util.rs:2139:48 | 2139 | match simd_json::serde::from_slice(&mut **&mut s_slice) { | ^^^^^^^^^^^^^^^^^^^ help: try: `&mut s_slice` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref --- src/util.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util.rs b/src/util.rs index 7ea606954..c12e5c66b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1992,7 +1992,7 @@ pub fn get_stats_records( break; } s_slice = curr_line.as_bytes().to_vec(); - match simd_json::serde::from_slice(&mut **&mut s_slice) { + match simd_json::serde::from_slice(&mut s_slice) { Ok(stats) => csv_stats.push(stats), Err(_) => continue, } @@ -2123,7 +2123,7 @@ pub fn get_stats_records( } // create a statsdatajon from the output of the stats command - csv_to_jsonl(&tempfile_path, &get_stats_data_types(), &statsdatajson_path)?; + csv_to_jsonl(&tempfile_path, &get_stats_data_types(), statsdatajson_path)?; let statsdatajson_rdr = BufReader::with_capacity(DEFAULT_RDR_BUFFER_CAPACITY, File::open(statsdatajson_path)?); @@ -2136,7 +2136,7 @@ pub fn get_stats_records( break; } s_slice = curr_line.as_bytes().to_vec(); - match simd_json::serde::from_slice(&mut **&mut s_slice) { + match simd_json::serde::from_slice(&mut s_slice) { Ok(stats) => csv_stats.push(stats), Err(_) => continue, }