File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
oxc_linter/src/rules/nextjs Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,6 @@ unused_peekable = "warn"
9696too_long_first_doc_paragraph = " warn"
9797suspicious_operation_groupings = " warn"
9898redundant_clone = " warn"
99- unnecessary_unwrap = " allow" # FIXME
10099needless_doctest_main = " allow" # FIXME
101100zero_sized_map_values = " allow" # FIXME https://github.com/rust-lang/rust-clippy/issues/15429
102101# cargo
Original file line number Diff line number Diff line change @@ -110,13 +110,14 @@ impl Rule for NoDuplicateHead {
110110 }
111111
112112 let node_id = reference. node_id ( ) ;
113- if first_node_id. is_none ( ) {
114- // First `<Head>` found
115- first_node_id = Some ( node_id) ;
116- } else if labels. is_empty ( ) {
113+ if labels. is_empty ( )
114+ && let Some ( first_node_id) = first_node_id
115+ {
117116 // 2nd `<Head>` found - populate `labels` with both
118- let first_node_id = first_node_id. unwrap ( ) ;
119117 labels. extend ( [ get_label ( first_node_id) , get_label ( node_id) ] ) ;
118+ } else if first_node_id. is_none ( ) {
119+ // First `<Head>` found
120+ first_node_id = Some ( node_id) ;
120121 } else {
121122 // Further `<Head>` found - add to `node_ids`
122123 labels. push ( get_label ( node_id) ) ;
Original file line number Diff line number Diff line change @@ -81,11 +81,13 @@ impl<'a> ParserImpl<'a> {
8181 let mut phase = None ;
8282 let mut import_kind = ImportOrExportKind :: Value ;
8383
84- if self . at ( Kind :: Eq ) && identifier_after_import. is_some ( ) {
84+ if self . at ( Kind :: Eq )
85+ && let Some ( identifier_after_import) = identifier_after_import
86+ {
8587 // `import something = ...`
8688 let decl = self . parse_ts_import_equals_declaration (
8789 ImportOrExportKind :: Value ,
88- identifier_after_import. unwrap ( ) ,
90+ identifier_after_import,
8991 span,
9092 ) ;
9193 return Statement :: from ( decl) ;
You can’t perform that action at this time.
0 commit comments