Skip to content

Commit

Permalink
fix: change fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Jul 9, 2024
1 parent 8ef4736 commit 66df08c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/mako/src/visitors/optimize_define_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl VisitMut for OptimizeDefineUtils {
let mut no_directive_index = 0;
for (index, item) in items.iter().enumerate() {
if let Some(stmt) = item.as_stmt()
&& is_directive_judged_by_stmt_value_and_raw(stmt.clone())
&& is_directive_judged_by_stmt_value_and_raw(stmt)
{
no_directive_index = index + 1
} else {
Expand Down Expand Up @@ -155,7 +155,7 @@ fn is_obj_lit_arg(arg: Option<&ExprOrSpread>) -> bool {
.unwrap_or(false)
}

fn is_directive_judged_by_stmt_value_and_raw(stmt: Stmt) -> bool {
fn is_directive_judged_by_stmt_value_and_raw(stmt: &Stmt) -> bool {
match stmt.as_ref() {
Some(Stmt::Expr(expr)) => match &*expr.expr {
Expr::Lit(Lit::Str(Str { raw: Some(raw), .. })) => {
Expand Down

0 comments on commit 66df08c

Please sign in to comment.