diff options
Diffstat (limited to 'test/test_dir.rs')
-rw-r--r-- | test/test_dir.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/test_dir.rs b/test/test_dir.rs index aaef34e4..9d2780c0 100644 --- a/test/test_dir.rs +++ b/test/test_dir.rs @@ -4,7 +4,6 @@ use nix::sys::stat::Mode; use std::fs::File; use tempfile::tempdir; - #[cfg(test)] fn flags() -> OFlag { #[cfg(target_os = "illumos")] @@ -17,7 +16,7 @@ fn flags() -> OFlag { } #[test] -#[allow(clippy::unnecessary_sort_by)] // False positive +#[allow(clippy::unnecessary_sort_by)] // False positive fn read() { let tmp = tempdir().unwrap(); File::create(&tmp.path().join("foo")).unwrap(); @@ -43,9 +42,18 @@ fn read() { fn rewind() { let tmp = tempdir().unwrap(); let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); - let entries1: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); - let entries2: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); - let entries3: Vec<_> = dir.into_iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries1: Vec<_> = dir + .iter() + .map(|e| e.unwrap().file_name().to_owned()) + .collect(); + let entries2: Vec<_> = dir + .iter() + .map(|e| e.unwrap().file_name().to_owned()) + .collect(); + let entries3: Vec<_> = dir + .into_iter() + .map(|e| e.unwrap().file_name().to_owned()) + .collect(); assert_eq!(entries1, entries2); assert_eq!(entries2, entries3); } |