Skip to content

Commit e98e664

Browse files
committed
Resolve explicit_iter_loop pedantic clippy lint
error: it is more concise to loop over references to containers instead of using explicit iteration methods --> tests/../src/lexical/math.rs:339:19 | 339 | for xi in x.iter_mut() { | ^^^^^^^^^^^^ help: to write this more concisely, try: `&mut *x` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop = note: `-D clippy::explicit-iter-loop` implied by `-D clippy::pedantic` error: it is more concise to loop over references to containers instead of using explicit iteration methods --> tests/../src/lexical/math.rs:485:19 | 485 | for xi in x.iter_mut() { | ^^^^^^^^^^^^ help: to write this more concisely, try: `&mut *x` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
1 parent fdb7800 commit e98e664

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lexical/math.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ mod small {
336336
pub fn imul(x: &mut Vec<Limb>, y: Limb) {
337337
// Multiply iteratively over all elements, adding the carry each time.
338338
let mut carry: Limb = 0;
339-
for xi in x.iter_mut() {
339+
for xi in &mut *x {
340340
carry = scalar::imul(xi, y, carry);
341341
}
342342

@@ -482,7 +482,7 @@ mod small {
482482
let rshift = bits - n;
483483
let lshift = n;
484484
let mut prev: Limb = 0;
485-
for xi in x.iter_mut() {
485+
for xi in &mut *x {
486486
let tmp = *xi;
487487
*xi <<= lshift;
488488
*xi |= prev >> rshift;

0 commit comments

Comments
 (0)