mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
refactor(transformer/react-refresh): unwrap BindingIdentifier::symbol_id (#6817)
Nit. `BindingIdentifier::symbol_id` should always be `Some`. Panic rather than exiting early if it's not.
This commit is contained in:
parent
4f6dc22a38
commit
57685b28e8
1 changed files with 1 additions and 1 deletions
|
|
@ -784,7 +784,7 @@ impl<'a, 'ctx> ReactRefresh<'a, 'ctx> {
|
||||||
let declarator = decl.declarations.first_mut().unwrap_or_else(|| unreachable!());
|
let declarator = decl.declarations.first_mut().unwrap_or_else(|| unreachable!());
|
||||||
let init = declarator.init.as_mut()?;
|
let init = declarator.init.as_mut()?;
|
||||||
let id = declarator.id.get_binding_identifier()?;
|
let id = declarator.id.get_binding_identifier()?;
|
||||||
let symbol_id = id.symbol_id.get()?;
|
let symbol_id = id.symbol_id.get().unwrap();
|
||||||
|
|
||||||
if !is_componentish_name(&id.name) {
|
if !is_componentish_name(&id.name) {
|
||||||
return None;
|
return None;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue