1
1
use std:: collections:: BTreeMap ;
2
- use std:: collections:: HashMap ;
3
2
use std:: convert:: { TryFrom , TryInto } ;
4
3
use std:: fs:: { read_dir, remove_dir, remove_file, rename, DirBuilder , File , FileType , OpenOptions , ReadDir } ;
5
4
use std:: io:: { Read , Seek , SeekFrom , Write } ;
6
5
use std:: path:: PathBuf ;
7
6
use std:: time:: SystemTime ;
8
7
8
+ use rustc_data_structures:: fx:: FxHashMap ;
9
9
use rustc:: ty:: layout:: { Align , LayoutOf , Size } ;
10
10
11
11
use crate :: stacked_borrows:: Tag ;
@@ -212,10 +212,10 @@ pub struct DirHandler {
212
212
/// When opendir is called, a directory iterator is created on the host for the target
213
213
/// directory, and an entry is stored in this hash map, indexed by an ID which represents
214
214
/// the directory stream. When readdir is called, the directory stream ID is used to look up
215
- /// the corresponding ReadDir iterator from this HashMap , and information from the next
215
+ /// the corresponding ReadDir iterator from this map , and information from the next
216
216
/// directory entry is returned. When closedir is called, the ReadDir iterator is removed from
217
- /// this HashMap .
218
- streams : HashMap < u64 , ReadDir > ,
217
+ /// the map .
218
+ streams : FxHashMap < u64 , ReadDir > ,
219
219
/// ID number to be used by the next call to opendir
220
220
next_id : u64 ,
221
221
}
@@ -232,7 +232,7 @@ impl DirHandler {
232
232
impl Default for DirHandler {
233
233
fn default ( ) -> DirHandler {
234
234
DirHandler {
235
- streams : HashMap :: new ( ) ,
235
+ streams : FxHashMap :: default ( ) ,
236
236
// Skip 0 as an ID, because it looks like a null pointer to libc
237
237
next_id : 1 ,
238
238
}
0 commit comments