Skip to content

Commit

Permalink
chore: iter to into
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Sep 25, 2024
1 parent c0b9e5e commit 1993386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/mako/src/module_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ impl ModuleGraph {
while let Some((edge_index, _node_index)) = edges.next(&self.graph) {
self.graph.remove_edge(edge_index);

Check warning on line 310 in crates/mako/src/module_graph.rs

View check run for this annotation

Codecov / codecov/patch

crates/mako/src/module_graph.rs#L310

Added line #L310 was not covered by tests
}
deps.iter().for_each(|(m, d)| {
self.add_dependency(module_id, m, d.clone());
deps.into_iter().for_each(|(m, d)| {
self.add_dependency(module_id, &m, d);
});

Check warning on line 314 in crates/mako/src/module_graph.rs

View check run for this annotation

Codecov / codecov/patch

crates/mako/src/module_graph.rs#L312-L314

Added lines #L312 - L314 were not covered by tests
}

Expand Down
4 changes: 2 additions & 2 deletions crates/mako/src/plugins/tree_shaking/shake/skip_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ pub(super) fn skip_module_optimize(
let info = &module.info.as_mut().unwrap();
let mut deps_vec: Vec<(ModuleId, Dependency)> = vec![];
let deps = analyze_deps::AnalyzeDeps::analyze_deps(&info.ast, &info.file, context.clone());
deps.unwrap().resolved_deps.iter().for_each(|r| {
deps.unwrap().resolved_deps.into_iter().for_each(|r| {
deps_vec.push((
ModuleId::new(r.resolver_resource.get_resolved_path()),
r.dependency.clone(),
r.dependency,

Check warning on line 336 in crates/mako/src/plugins/tree_shaking/shake/skip_module.rs

View check run for this annotation

Codecov / codecov/patch

crates/mako/src/plugins/tree_shaking/shake/skip_module.rs#L330-L336

Added lines #L330 - L336 were not covered by tests
));
});
module_graph.rewrite_dependency(module_id, deps_vec);

Check warning on line 339 in crates/mako/src/plugins/tree_shaking/shake/skip_module.rs

View check run for this annotation

Codecov / codecov/patch

crates/mako/src/plugins/tree_shaking/shake/skip_module.rs#L338-L339

Added lines #L338 - L339 were not covered by tests
Expand Down

0 comments on commit 1993386

Please sign in to comment.