From 48cc5f28b158f853c1755ccadb958ce20d8a9007 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Thu, 19 Dec 2019 00:47:33 +0100 Subject: Don't use misleading `<&[T; N] as IntoIterator>::into_iter` See https://github.com/rust-lang/rust/pull/65819. Warned against by default since Rust 1.41. Right now `into_iter` returns references to objects inside an array rather than moving the values (as one would expect) so it makes sense to use `iter()` or for-in-borrowed (which calls the same thing) to retain the behaviour but make it less confusing. --- openpgp/src/message/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openpgp/src/message/mod.rs') diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs index a43f2c59..51c548e0 100644 --- a/openpgp/src/message/mod.rs +++ b/openpgp/src/message/mod.rs @@ -581,7 +581,7 @@ mod tests { }, ]; - for v in test_vectors.into_iter() { + for v in &test_vectors { if v.result { let mut l = MessageValidator::new(); for token in v.s.iter() { @@ -700,7 +700,7 @@ mod tests { }, ]; - for v in test_vectors.into_iter() { + for v in &test_vectors { let mut l = MessageValidator::new(); for (token, depth) in v.s.iter() { l.push(*token, -- cgit v1.2.3