mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
refactor(semantic): replace ref syntax (#5253)
Pure code style refactor. Prefer `if let Some(y) = &x.y` over `if let Some(ref y) = x.y`.
This commit is contained in:
parent
cbb47252ba
commit
892a7fab60
1 changed files with 3 additions and 5 deletions
|
|
@ -653,7 +653,7 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
|
|||
let node_id = self.current_node_id;
|
||||
/* cfg */
|
||||
|
||||
if let Some(ref break_target) = stmt.label {
|
||||
if let Some(break_target) = &stmt.label {
|
||||
self.visit_label_identifier(break_target);
|
||||
}
|
||||
|
||||
|
|
@ -1715,10 +1715,8 @@ impl<'a> SemanticBuilder<'a> {
|
|||
AstKind::ExportDefaultDeclaration(decl) => {
|
||||
// Only if the declaration has an ID, we mark it as an export
|
||||
if match &decl.declaration {
|
||||
ExportDefaultDeclarationKind::FunctionDeclaration(ref func) => {
|
||||
func.id.is_some()
|
||||
}
|
||||
ExportDefaultDeclarationKind::ClassDeclaration(ref class) => class.id.is_some(),
|
||||
ExportDefaultDeclarationKind::FunctionDeclaration(func) => func.id.is_some(),
|
||||
ExportDefaultDeclarationKind::ClassDeclaration(class) => class.id.is_some(),
|
||||
ExportDefaultDeclarationKind::TSInterfaceDeclaration(_) => true,
|
||||
_ => false,
|
||||
} {
|
||||
|
|
|
|||
Loading…
Reference in a new issue