Skip to content

Commit

Permalink
clippy:needless_borrow
Browse files Browse the repository at this point in the history
warning: this expression borrows a value the compiler would automatically borrow
   --> src/cmd/extsort.rs:233:52
    |
233 |         let Ok(position) = atoi_simd::parse::<u64>((&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
  • Loading branch information
jqnatividad committed Oct 14, 2024
1 parent 330bdc5 commit 8ea48b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cmd/extsort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ fn sort_csv(

for l in sorted_line_rdr.lines() {
line.clone_from(&l?);
let Ok(position) = atoi_simd::parse::<u64>((&line[line.len() - width..]).as_bytes()) else {
let Ok(position) = atoi_simd::parse::<u64>(line[line.len() - width..].as_bytes()) else {
return fail!("Failed to retrieve position: invalid integer");
};

Expand Down

0 comments on commit 8ea48b3

Please sign in to comment.