Skip to content

Commit

Permalink
refactor: 🎨 remove unnessary clone
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Jan 2, 2024
1 parent 1548f7e commit 07e25a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/mako/src/transform_in_generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ pub fn transform_modules_in_thread(
insert_swc_helper_replace(&mut resolved_deps, &context);
let module = module_graph.get_module(&module_id).unwrap();
let info = module.info.as_ref().unwrap();
let ast = &mut info.ast.clone();
let ast = info.ast.clone();
let deps_to_replace = DependenciesToReplace {
resolved: resolved_deps,
missing: info.missing_deps.clone(),
ignored: info.ignored_deps.clone(),
};
if let ModuleAst::Script(ast) = ast {
if let ModuleAst::Script(mut ast) = ast {
let ret = transform_js_generate(TransformJsParam {
module_id: &module.id,
context: &context,
ast,
ast: &mut ast,
dep_map: &deps_to_replace,
async_deps: &async_deps,
wrap_async: info.is_async && info.external.is_none(),
Expand All @@ -143,7 +143,7 @@ pub fn transform_modules_in_thread(
} else {
Some(SwcHelpers::get_swc_helpers(&ast.ast, &context))
};
Ok((module_id, ModuleAst::Script(ast.clone()), swc_helpers))
Ok((module_id, ModuleAst::Script(ast), swc_helpers))
}
Err(e) => Err(e),
};
Expand Down

0 comments on commit 07e25a2

Please sign in to comment.