Skip to content

Commit

Permalink
chore: apply clippy suggestions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jqnatividad committed Nov 21, 2024
1 parent 0132fcf commit 219eb84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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)?);
Expand All @@ -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,
}
Expand Down

0 comments on commit 219eb84

Please sign in to comment.