Skip to content

Commit

Permalink
Resolve needless_borrow clippy lint
Browse files Browse the repository at this point in the history
    error: this expression borrows a value the compiler would automatically borrow
       --> tests/../src/lexical/math.rs:597:25
        |
    597 |         for (xi, yi) in (&mut x[xstart..]).iter_mut().zip(y.iter()) {
        |                         ^^^^^^^^^^^^^^^^^^ help: change this to: `x[xstart..]`
        |
        = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
  • Loading branch information
dtolnay committed Jan 29, 2022
1 parent 98cafac commit aa78d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lexical/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ mod large {

// Iteratively add elements from y to x.
let mut carry = false;
for (xi, yi) in (&mut x[xstart..]).iter_mut().zip(y.iter()) {
for (xi, yi) in x[xstart..].iter_mut().zip(y.iter()) {
// Only one op of the two can overflow, since we added at max
// Limb::max_value() + Limb::max_value(). Add the previous carry,
// and store the current carry for the next.
Expand Down

0 comments on commit aa78d6c

Please sign in to comment.