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+
16use 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 } ;
68
79use crate :: fs:: FileType ;
810use crate :: util;
2628 T : AsRef < [ u8 ] > ,
2729{
2830 storage : T ,
29- pub files : HashMap < String , Entry > ,
30- pub dirs : HashSet < String > ,
31+ pub files : FxHashMap < String , Entry > ,
32+ pub dirs : FxHashSet < String > ,
3133}
3234
3335impl < T > Zip < T >
@@ -103,8 +105,8 @@ fn make_io_utf8_error() -> std::io::Error {
103105 std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidData , "File did not contain valid UTF-8" )
104106}
105107
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 ( ) ;
108110 let mut cursor = Cursor :: new ( data) ;
109111
110112 let central_directory_offset = find_central_directory_offset ( & mut cursor) ?;
You can’t perform that action at this time.
0 commit comments