Skip to content

Commit

Permalink
Resolve explicit_iter_loop pedantic clippy lint
Browse files Browse the repository at this point in the history
    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`
  • Loading branch information
dtolnay committed Jul 3, 2023
1 parent 603c57a commit fbd310e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit fbd310e

Please # to comment.