From c9f5f0473d0566501ee2c1d09bcb4396af6a1482 Mon Sep 17 00:00:00 2001 From: rzvxa Date: Thu, 29 Aug 2024 12:02:47 +0330 Subject: [PATCH] refactor --- crates/oxc_prettier/src/format/call_arguments.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_prettier/src/format/call_arguments.rs b/crates/oxc_prettier/src/format/call_arguments.rs index c68d6e867d7f45..f4a84b252fd61d 100644 --- a/crates/oxc_prettier/src/format/call_arguments.rs +++ b/crates/oxc_prettier/src/format/call_arguments.rs @@ -238,7 +238,7 @@ fn is_hopefully_short_call_argument(mut node: &Expression) -> bool { fn is_simple_call_argument(node: &Expression, depth: usize) -> bool { if let Expression::RegExpLiteral(literal) = node { - return literal.regex.pattern.body.span.len() <= 5; + return literal.regex.pattern.body.span.size() <= 5; } if node.is_literal() || is_string_word_type(node) {