Resolve needless_borrow clippy lint

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
This commit is contained in:
David Tolnay 2022-01-28 19:00:03 -08:00
parent 98cafacefe
commit aa78d6ca4e
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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.