File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change
1
+ use std:: {
2
+ error:: Error ,
3
+ io:: { Cursor , Read } ,
4
+ } ;
5
+
1
6
use byteorder:: { LittleEndian , ReadBytesExt } ;
2
- use std:: collections:: { HashMap , HashSet } ;
3
- use std:: error:: Error ;
4
- use std:: io:: Cursor ;
5
- use std:: io:: Read ;
7
+ use rustc_hash:: { FxHashMap , FxHashSet } ;
6
8
7
9
use crate :: fs:: FileType ;
8
10
use crate :: util;
26
28
T : AsRef < [ u8 ] > ,
27
29
{
28
30
storage : T ,
29
- pub files : HashMap < String , Entry > ,
30
- pub dirs : HashSet < String > ,
31
+ pub files : FxHashMap < String , Entry > ,
32
+ pub dirs : FxHashSet < String > ,
31
33
}
32
34
33
35
impl < T > Zip < T >
@@ -103,8 +105,8 @@ fn make_io_utf8_error() -> std::io::Error {
103
105
std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidData , "File did not contain valid UTF-8" )
104
106
}
105
107
106
- pub fn list_zip_entries ( data : & [ u8 ] ) -> Result < HashMap < String , Option < Entry > > , Box < dyn Error > > {
107
- let mut zip_entries = HashMap :: new ( ) ;
108
+ pub fn list_zip_entries ( data : & [ u8 ] ) -> Result < FxHashMap < String , Option < Entry > > , Box < dyn Error > > {
109
+ let mut zip_entries = FxHashMap :: default ( ) ;
108
110
let mut cursor = Cursor :: new ( data) ;
109
111
110
112
let central_directory_offset = find_central_directory_offset ( & mut cursor) ?;
You can’t perform that action at this time.
0 commit comments