From 6a8a8557d26b38ce6d19a8f4f2f7fa1db5523b0c Mon Sep 17 00:00:00 2001 From: Mathias Svensson Date: Thu, 31 Oct 2019 12:59:50 +0100 Subject: [PATCH] Use `slice::iter` instead of `into_iter` to avoid future breakage (#679) * Use `slice::iter` instead of `into_iter` to avoid future breakage `an_array.into_iter()` currently just works because of the autoref feature, which then calls `<[T] as IntoIterator>::into_iter`. But in the future, arrays will implement `IntoIterator`, too. In order to avoid problems in the future, the call is replaced by `iter()` which is shorter and more explicit. * cargo fmt --- src/directory/managed_directory.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/directory/managed_directory.rs b/src/directory/managed_directory.rs index f72668fa1..2954b48de 100644 --- a/src/directory/managed_directory.rs +++ b/src/directory/managed_directory.rs @@ -327,8 +327,7 @@ mod tests_mmap_specific { .unwrap(); assert!(managed_directory.exists(test_path1)); assert!(managed_directory.exists(test_path2)); - let living_files: HashSet = - [test_path1.to_owned()].into_iter().cloned().collect(); + let living_files: HashSet = [test_path1.to_owned()].iter().cloned().collect(); managed_directory.garbage_collect(|| living_files); assert!(managed_directory.exists(test_path1)); assert!(!managed_directory.exists(test_path2));