File tree Expand file tree Collapse file tree 5 files changed +12
-14
lines changed
compilation/build_chunk_graph Expand file tree Collapse file tree 5 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,9 @@ impl Chunk {
329329 group. insert_chunk ( new_chunk. ukey , self . ukey ) ;
330330 new_chunk. add_group ( group. ukey ) ;
331331 }
332- new_chunk. id_name_hints . extend ( self . id_name_hints . clone ( ) ) ;
332+ new_chunk
333+ . id_name_hints
334+ . extend ( self . id_name_hints . iter ( ) . cloned ( ) ) ;
333335 new_chunk. runtime . extend ( & self . runtime ) ;
334336 }
335337
@@ -618,12 +620,13 @@ impl Chunk {
618620 }
619621 }
620622
621- for chunk_group_ukey in initial_queue. clone ( ) . iter ( ) {
623+ let initial_keys: Vec < _ > = initial_queue. iter ( ) . copied ( ) . collect ( ) ;
624+ for chunk_group_ukey in initial_keys {
622625 add_to_queue (
623626 chunk_group_by_ukey,
624627 & mut queue,
625628 & mut initial_queue,
626- chunk_group_ukey,
629+ & chunk_group_ukey,
627630 ) ;
628631 }
629632
@@ -895,13 +898,8 @@ impl Chunk {
895898 if include_direct_children {
896899 for chunk_ukey in self
897900 . get_sorted_groups_iter ( & compilation. chunk_group_by_ukey )
898- . filter_map ( |chunk_group_ukey| {
899- compilation
900- . chunk_group_by_ukey
901- . get ( chunk_group_ukey)
902- . map ( |g| g. chunks . clone ( ) )
903- } )
904- . flatten ( )
901+ . filter_map ( |chunk_group_ukey| compilation. chunk_group_by_ukey . get ( chunk_group_ukey) )
902+ . flat_map ( |g| g. chunks . iter ( ) . copied ( ) )
905903 {
906904 add_child_ids_task. push ( ( chunk_ukey, ChunkGroupOrderKey :: Prefetch ) ) ;
907905 add_child_ids_task. push ( ( chunk_ukey, ChunkGroupOrderKey :: Preload ) ) ;
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ impl CodeSplitter {
310310
311311 for chunk_ukey in & cgm. chunks {
312312 let chunk = compilation. chunk_by_ukey . expect_get ( chunk_ukey) ;
313- chunk_groups. extend ( chunk. groups ( ) . clone ( ) ) ;
313+ chunk_groups. extend ( chunk. groups ( ) . iter ( ) . copied ( ) ) ;
314314 }
315315 }
316316 for group in chunk_groups {
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ impl Compiler {
6767 removed_files. extend ( deleted_files. iter ( ) . map ( |files| Path :: new ( files) . into ( ) ) ) ;
6868
6969 let mut all_files = modified_files. clone ( ) ;
70- all_files. extend ( removed_files. clone ( ) ) ;
70+ all_files. extend ( removed_files. iter ( ) . cloned ( ) ) ;
7171
7272 self . plugin_driver . clear_cache ( self . compilation . id ( ) ) ;
7373
Original file line number Diff line number Diff line change @@ -900,7 +900,7 @@ impl Module for ConcatenatedModule {
900900 continue ;
901901 } ;
902902 if info. has_ast {
903- all_used_names. extend ( info. all_used_names . clone ( ) ) ;
903+ all_used_names. extend ( info. all_used_names . iter ( ) . cloned ( ) ) ;
904904 }
905905 }
906906
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub fn get_entry_runtime(
1818 if let Some ( depend_on) = & options. depend_on {
1919 let mut result: RuntimeSpec = Default :: default ( ) ;
2020 let mut queue = vec ! [ ] ;
21- queue. extend ( depend_on. clone ( ) ) ;
21+ queue. extend ( depend_on. iter ( ) . cloned ( ) ) ;
2222
2323 let mut visited = HashSet :: < String > :: default ( ) ;
2424
You can’t perform that action at this time.
0 commit comments