diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-27 15:04:33 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:09 +0300 |
commit | ca60dfac80459e5fc91d4d6a5b8e76895d3a0f47 (patch) | |
tree | a203852e43459d37f786281b25c6f84dc55b7b65 /openpgp/src/types | |
parent | b7ebecb5e98c2eb2103f8dab0bc609e2aeb63632 (diff) |
Use .iter() instead of .into_iter()
Just call the .iter() method instead of .into_iter() when either is
OK. The shorter form is shorter and should thus be easier to read.
Found by clippy lint into_iter_on_ref:
https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
Diffstat (limited to 'openpgp/src/types')
-rw-r--r-- | openpgp/src/types/key_flags.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/types/key_flags.rs b/openpgp/src/types/key_flags.rs index 292afb6a..03bf9f1f 100644 --- a/openpgp/src/types/key_flags.rs +++ b/openpgp/src/types/key_flags.rs @@ -113,7 +113,7 @@ impl BitAnd for &KeyFlags { let r = rhs.as_slice(); let mut c = Vec::with_capacity(std::cmp::min(l.len(), r.len())); - for (l, r) in l.into_iter().zip(r.into_iter()) { + for (l, r) in l.iter().zip(r.iter()) { c.push(l & r); } @@ -136,7 +136,7 @@ impl BitOr for &KeyFlags { }; let mut l = l.to_vec(); - for (i, r) in r.into_iter().enumerate() { + for (i, r) in r.iter().enumerate() { l[i] |= r; } |