File tree 3 files changed +6
-8
lines changed
packages/next-swc/crates/core/src
3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ impl VisitMut for CjsOptimizer {
233
233
self . data . imports . insert (
234
234
key,
235
235
ImportRecord {
236
- module_specifier : v. value . clone ( ) . into ( ) ,
236
+ module_specifier : v. value . clone ( ) ,
237
237
} ,
238
238
) ;
239
239
}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl Fold for OptimizeServerReact {
68
68
new_items. push ( item. clone ( ) . fold_with ( self ) ) ;
69
69
70
70
if let ModuleItem :: ModuleDecl ( ModuleDecl :: Import ( import_decl) ) = & item {
71
- if import_decl. src . value . to_string ( ) != "react" {
71
+ if import_decl. src . value != "react" {
72
72
continue ;
73
73
}
74
74
for specifier in & import_decl. specifiers {
@@ -119,9 +119,7 @@ impl Fold for OptimizeServerReact {
119
119
if & f. to_id ( ) == react_ident {
120
120
if let MemberProp :: Ident ( i) = & member. prop {
121
121
// Remove `React.useEffect` and `React.useLayoutEffect` calls
122
- if i. sym . to_string ( ) == "useEffect"
123
- || i. sym . to_string ( ) == "useLayoutEffect"
124
- {
122
+ if i. sym == "useEffect" || i. sym == "useLayoutEffect" {
125
123
return Expr :: Lit ( Lit :: Null ( Null { span : DUMMY_SP } ) ) ;
126
124
}
127
125
}
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ impl Fold for PageConfig {
77
77
for decl in & var_decl. decls {
78
78
let mut is_config = false ;
79
79
if let Pat :: Ident ( ident) = & decl. name {
80
- if & ident. id . sym == CONFIG_KEY {
80
+ if ident. id . sym == CONFIG_KEY {
81
81
is_config = true ;
82
82
}
83
83
}
@@ -151,14 +151,14 @@ impl Fold for PageConfig {
151
151
match & specifier. exported {
152
152
Some ( ident) => {
153
153
if let ModuleExportName :: Ident ( ident) = ident {
154
- if & ident. sym == CONFIG_KEY {
154
+ if ident. sym == CONFIG_KEY {
155
155
self . handle_error ( "Config cannot be re-exported." , specifier. span )
156
156
}
157
157
}
158
158
}
159
159
None => {
160
160
if let ModuleExportName :: Ident ( ident) = & specifier. orig {
161
- if & ident. sym == CONFIG_KEY {
161
+ if ident. sym == CONFIG_KEY {
162
162
self . handle_error ( "Config cannot be re-exported." , specifier. span )
163
163
}
164
164
}
You can’t perform that action at this time.
0 commit comments