@@ -261,7 +261,7 @@ impl<'a> PeepholeOptimizations {
261261 /// filters anyway.
262262 fn is_cheap_to_number_operand ( e : & Expression < ' a > ) -> bool {
263263 matches ! (
264- e. get_inner_expression ( ) ,
264+ e,
265265 Expression :: NumericLiteral ( _)
266266 | Expression :: StringLiteral ( _)
267267 | Expression :: BooleanLiteral ( _)
@@ -411,7 +411,7 @@ impl<'a> PeepholeOptimizations {
411411 /// Lower bound for the minified size of a numeric expression. Parentheses are deliberately
412412 /// omitted, so accepting a fold based on this count cannot make the output longer.
413413 fn numeric_expression_size_lower_bound ( expr : & Expression < ' a > ) -> Option < usize > {
414- match expr. get_inner_expression ( ) {
414+ match expr {
415415 Expression :: NumericLiteral ( lit) => Self :: number_literal_source_len ( lit. value ) ,
416416 Expression :: UnaryExpression ( e)
417417 if matches ! (
@@ -484,7 +484,7 @@ impl<'a> PeepholeOptimizations {
484484 expr : & Expression < ' a > ,
485485 ctx : & TraverseCtx < ' a > ,
486486 ) -> Option < ( usize , bool ) > {
487- let result = match expr. get_inner_expression ( ) {
487+ let result = match expr {
488488 Expression :: StringLiteral ( lit) => ( lit. value . len ( ) + 2 , false ) ,
489489 Expression :: NumericLiteral ( lit) => ( Self :: number_literal_source_len ( lit. value ) ?, false ) ,
490490 Expression :: BooleanLiteral ( _) => ( 2 , false ) ,
@@ -1063,7 +1063,7 @@ fn try_fold_chain_at_element<'a>(
10631063}
10641064
10651065fn try_fold_chain_at_expr < ' a > ( expr : & mut Expression < ' a > , ctx : & TraverseCtx < ' a > ) -> ChainFold < ' a > {
1066- match expr. get_inner_expression_mut ( ) {
1066+ match expr {
10671067 Expression :: CallExpression ( c) => try_fold_call_expression ( c, ctx) ,
10681068 match_member_expression ! ( Expression ) => {
10691069 try_fold_member_expression ( expr. to_member_expression_mut ( ) , ctx)
@@ -1161,7 +1161,7 @@ fn try_fold_at_optional<'a>(
11611161/// [`cjs-module-lexer`]: https://github.com/nodejs/cjs-module-lexer
11621162/// [esbuild]: https://github.com/evanw/esbuild/blob/v0.28.0/internal/linker/linker.go#L5127-L5138
11631163pub ( super ) fn is_cjs_module_exports_hint ( expr : & Expression < ' _ > ) -> bool {
1164- let Expression :: AssignmentExpression ( assign) = expr. get_inner_expression ( ) else {
1164+ let Expression :: AssignmentExpression ( assign) = expr else {
11651165 return false ;
11661166 } ;
11671167 assign. operator == AssignmentOperator :: Assign
0 commit comments