mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
feat(span): impl<'a> PartialEq<str> for Atom<'a> (#2649)
This commit is contained in:
parent
c72675e89e
commit
8b3de7748b
2 changed files with 7 additions and 1 deletions
|
|
@ -244,7 +244,7 @@ fn check_expression(expr: &Expression, ctx: &LintContext<'_>) -> Option<oxc_span
|
|||
}
|
||||
}
|
||||
Expression::TemplateLiteral(lit) => {
|
||||
lit.quasi().and_then(|quasi| if quasi == &"then" { Some(lit.span) } else { None })
|
||||
lit.quasi().and_then(|quasi| if quasi == "then" { Some(lit.span) } else { None })
|
||||
}
|
||||
Expression::Identifier(ident) => {
|
||||
let tab = ctx.semantic().symbols();
|
||||
|
|
|
|||
|
|
@ -92,6 +92,12 @@ impl<'a> PartialEq<Atom<'a>> for &str {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq<str> for Atom<'a> {
|
||||
fn eq(&self, other: &str) -> bool {
|
||||
self.as_str() == other
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> hash::Hash for Atom<'a> {
|
||||
fn hash<H: hash::Hasher>(&self, hasher: &mut H) {
|
||||
self.as_str().hash(hasher);
|
||||
|
|
|
|||
Loading…
Reference in a new issue