Skip to main content

oxc_css_parser/tokenizer/
misc.rs

1use super::{TokenWithSpan, token::Ident};
2use crate::{SpanIgnoredEq, util};
3use std::borrow::Cow;
4
5impl<'s> Ident<'s> {
6    #[inline]
7    pub fn name(&self) -> Cow<'s, str> {
8        if self.escaped { util::handle_escape(self.raw) } else { Cow::from(self.raw) }
9    }
10}
11
12impl SpanIgnoredEq for TokenWithSpan<'_> {
13    #[inline]
14    fn span_ignored_eq(&self, other: &Self) -> bool {
15        self.token == other.token
16    }
17}