mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(semantic): shorten code (#4358)
Code style: Remove unnecessary assignments to `_`.
This commit is contained in:
parent
7eb286413e
commit
729b288c5d
3 changed files with 11 additions and 11 deletions
|
|
@ -112,11 +112,11 @@ fn unexpected_type_annotation(span0: Span) -> OxcDiagnostic {
|
||||||
|
|
||||||
pub fn check_array_pattern<'a>(pattern: &ArrayPattern<'a>, ctx: &SemanticBuilder<'a>) {
|
pub fn check_array_pattern<'a>(pattern: &ArrayPattern<'a>, ctx: &SemanticBuilder<'a>) {
|
||||||
for element in &pattern.elements {
|
for element in &pattern.elements {
|
||||||
let _ = element.as_ref().map(|element| {
|
if let Some(element) = element.as_ref() {
|
||||||
if let Some(type_annotation) = &element.type_annotation {
|
if let Some(type_annotation) = &element.type_annotation {
|
||||||
ctx.error(unexpected_type_annotation(type_annotation.span));
|
ctx.error(unexpected_type_annotation(type_annotation.span));
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,10 +198,10 @@ impl ScopeTree {
|
||||||
flags: ScopeFlags,
|
flags: ScopeFlags,
|
||||||
) -> ScopeId {
|
) -> ScopeId {
|
||||||
let scope_id = self.parent_ids.push(parent_id);
|
let scope_id = self.parent_ids.push(parent_id);
|
||||||
_ = self.child_ids.push(vec![]);
|
self.child_ids.push(vec![]);
|
||||||
_ = self.flags.push(flags);
|
self.flags.push(flags);
|
||||||
_ = self.bindings.push(Bindings::default());
|
self.bindings.push(Bindings::default());
|
||||||
_ = self.node_ids.push(node_id);
|
self.node_ids.push(node_id);
|
||||||
|
|
||||||
// Set this scope as child of parent scope.
|
// Set this scope as child of parent scope.
|
||||||
if let Some(parent_id) = parent_id {
|
if let Some(parent_id) = parent_id {
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,11 @@ impl SymbolTable {
|
||||||
flag: SymbolFlags,
|
flag: SymbolFlags,
|
||||||
scope_id: ScopeId,
|
scope_id: ScopeId,
|
||||||
) -> SymbolId {
|
) -> SymbolId {
|
||||||
_ = self.spans.push(span);
|
self.spans.push(span);
|
||||||
_ = self.names.push(name);
|
self.names.push(name);
|
||||||
_ = self.flags.push(flag);
|
self.flags.push(flag);
|
||||||
_ = self.scope_ids.push(scope_id);
|
self.scope_ids.push(scope_id);
|
||||||
_ = self.resolved_references.push(vec![]);
|
self.resolved_references.push(vec![]);
|
||||||
self.redeclare_variables.push(vec![])
|
self.redeclare_variables.push(vec![])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue