From 8ea48b336cf5d6859cd1212c163c0c16bbff3764 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Mon, 14 Oct 2024 07:07:46 -0400 Subject: [PATCH] clippy:needless_borrow warning: this expression borrows a value the compiler would automatically borrow --> src/cmd/extsort.rs:233:52 | 233 | let Ok(position) = atoi_simd::parse::((&line[line.len() - width..]).as_bytes()) else { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `line[line.len() - width..]` | = 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 --- Cargo.lock | 4 ++-- src/cmd/extsort.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3dcb78fd3..e8e398eb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6717,9 +6717,9 @@ dependencies = [ [[package]] name = "sorted-vec" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6734caf0b6f51addd5eeacca12fb39b2c6c14e8d4f3ac42f3a78955c0467458" +checksum = "2432f7c120a790d329ee1c54c9c09495b163a72eb338b0682742e2c173b15107" [[package]] name = "spin" diff --git a/src/cmd/extsort.rs b/src/cmd/extsort.rs index 6969cdde5..3491b6517 100644 --- a/src/cmd/extsort.rs +++ b/src/cmd/extsort.rs @@ -230,7 +230,7 @@ fn sort_csv( for l in sorted_line_rdr.lines() { line.clone_from(&l?); - let Ok(position) = atoi_simd::parse::((&line[line.len() - width..]).as_bytes()) else { + let Ok(position) = atoi_simd::parse::(line[line.len() - width..].as_bytes()) else { return fail!("Failed to retrieve position: invalid integer"); };