@@ -5,10 +5,7 @@ mod data;
55mod options;
66mod utils;
77
8- use std:: {
9- cell:: RefCell ,
10- collections:: { HashMap , HashSet } ,
11- } ;
8+ use std:: cell:: RefCell ;
129
1310use asset:: {
1411 collect_assets_for_module, collect_assets_from_chunk, collect_usage_files_for_module,
@@ -31,6 +28,7 @@ use rspack_core::{
3128} ;
3229use rspack_error:: Result ;
3330use rspack_hook:: { plugin, plugin_hook} ;
31+ use rspack_util:: fx_hash:: { FxHashMap as HashMap , FxHashSet as HashSet } ;
3432use utils:: {
3533 collect_expose_requirements, compose_id_with_separator, ensure_shared_entry, is_hot_file,
3634 parse_consume_shared_identifier, parse_container_exposes_from_identifier,
@@ -228,15 +226,15 @@ async fn process_assets(&self, compilation: &mut Compilation) -> Result<()> {
228226 errors : false ,
229227 } ;
230228 // Gather modules
231- let exposes_map = RefCell :: new ( HashMap :: < String , StatsExpose > :: new ( ) ) ;
232- let shared_map = RefCell :: new ( HashMap :: < String , StatsShared > :: new ( ) ) ;
229+ let exposes_map = RefCell :: new ( HashMap :: < String , StatsExpose > :: default ( ) ) ;
230+ let shared_map = RefCell :: new ( HashMap :: < String , StatsShared > :: default ( ) ) ;
233231 let shared_usage_links = RefCell :: new ( Vec :: < ( String , String ) > :: new ( ) ) ;
234- let provide_module_ids = RefCell :: new ( HashMap :: < String , Vec < ModuleIdentifier > > :: new ( ) ) ;
235- let consume_module_ids = RefCell :: new ( HashMap :: < String , Vec < ModuleIdentifier > > :: new ( ) ) ;
232+ let provide_module_ids = RefCell :: new ( HashMap :: < String , Vec < ModuleIdentifier > > :: default ( ) ) ;
233+ let consume_module_ids = RefCell :: new ( HashMap :: < String , Vec < ModuleIdentifier > > :: default ( ) ) ;
236234 let remote_module_ids = RefCell :: new ( Vec :: < ModuleIdentifier > :: new ( ) ) ;
237235 let container_entry_module = RefCell :: new ( None :: < ModuleIdentifier > ) ;
238- let module_ids_by_name = RefCell :: new ( HashMap :: < String , ModuleIdentifier > :: new ( ) ) ;
239- let self_issued_module_ids = RefCell :: new ( HashMap :: < String , ModuleIdentifier > :: new ( ) ) ;
236+ let module_ids_by_name = RefCell :: new ( HashMap :: < String , ModuleIdentifier > :: default ( ) ) ;
237+ let self_issued_module_ids = RefCell :: new ( HashMap :: < String , ModuleIdentifier > :: default ( ) ) ;
240238 stats. get_modules ( & options, |modules| {
241239 for m in modules {
242240 let module_identifier = match m. identifier {
@@ -335,7 +333,7 @@ async fn process_assets(&self, compilation: &mut Compilation) -> Result<()> {
335333 let shared_usage_links = shared_usage_links. into_inner ( ) ;
336334 collect_expose_requirements ( & mut shared_map, & mut exposes_map, shared_usage_links) ;
337335
338- let mut aggregated_shared_assets: HashMap < String , StatsAssetsGroup > = HashMap :: new ( ) ;
336+ let mut aggregated_shared_assets: HashMap < String , StatsAssetsGroup > = HashMap :: default ( ) ;
339337 for ( pkg, module_ids) in & consume_module_ids {
340338 let entry = aggregated_shared_assets
341339 . entry ( pkg. clone ( ) )
0 commit comments