From aa78d6ca4e26bca42156aa7185d35c637c38b644 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 28 Jan 2022 19:00:03 -0800 Subject: [PATCH] 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 --- src/lexical/math.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lexical/math.rs b/src/lexical/math.rs index 0925d0c..37cc1d2 100644 --- a/src/lexical/math.rs +++ b/src/lexical/math.rs @@ -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.