mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
feat(es/parser): Implement AsRef<str>
for IdentLike
(#8133)
This commit is contained in:
parent
5bb63aa2a2
commit
bffe33a270
@ -583,6 +583,15 @@ impl From<&'_ str> for IdentLike {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<str> for IdentLike {
|
||||
fn as_ref(&self) -> &str {
|
||||
match self {
|
||||
IdentLike::Known(k) => (*k).into(),
|
||||
IdentLike::Other(s) => s.as_ref(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Keyword> for Word {
|
||||
fn from(kwd: Keyword) -> Self {
|
||||
Word::Keyword(kwd)
|
||||
|
Loading…
Reference in New Issue
Block a user