From fbd310e83e5f87a1a9bdd5f1fe551cf2dca7ef9c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 2 Jul 2023 20:07:44 -0700 Subject: [PATCH] Resolve explicit_iter_loop pedantic clippy lint error: it is more concise to loop over references to containers instead of using explicit iteration methods --> src/expand.rs:177:16 | 177 | for arg in sig.inputs.iter_mut() { | ^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut sig.inputs` | = 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` --- src/expand.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expand.rs b/src/expand.rs index 0a1ef1c..20ee80c 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -174,7 +174,7 @@ fn transform_sig( }; let mut lifetimes = CollectLifetimes::new(); - for arg in sig.inputs.iter_mut() { + for arg in &mut sig.inputs { match arg { FnArg::Receiver(arg) => lifetimes.visit_receiver_mut(arg), FnArg::Typed(arg) => lifetimes.visit_type_mut(&mut arg.ty),