Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 60265e4

Browse files
committed
avoid using HashMap in fs test
1 parent cbe2ec0 commit 60265e4

File tree

1 file changed

+3
-3
lines changed
  • src/tools/miri/tests/pass/shims

1 file changed

+3
-3
lines changed

src/tools/miri/tests/pass/shims/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(io_error_more)]
55
#![feature(io_error_uncategorized)]
66

7-
use std::collections::HashMap;
7+
use std::collections::BTreeMap;
88
use std::ffi::OsString;
99
use std::fs::{
1010
File, OpenOptions, canonicalize, create_dir, read_dir, remove_dir, remove_dir_all, remove_file,
@@ -262,7 +262,7 @@ fn test_directory() {
262262
create_dir(&dir_1).unwrap();
263263
// Test that read_dir metadata calls succeed
264264
assert_eq!(
265-
HashMap::from([
265+
BTreeMap::from([
266266
(OsString::from("test_file_1"), true),
267267
(OsString::from("test_file_2"), true),
268268
(OsString::from("test_dir_1"), false)
@@ -273,7 +273,7 @@ fn test_directory() {
273273
let e = e.unwrap();
274274
(e.file_name(), e.metadata().unwrap().is_file())
275275
})
276-
.collect::<HashMap<_, _>>()
276+
.collect::<BTreeMap<_, _>>()
277277
);
278278
// Deleting the directory should fail, since it is not empty.
279279
assert_eq!(ErrorKind::DirectoryNotEmpty, remove_dir(&dir_path).unwrap_err().kind());

0 commit comments

Comments
 (0)