Inline two Ident methods.

This commit is contained in:
Nicholas Nethercote 2022-09-28 14:45:31 +10:00
parent 2aa028d30d
commit a8d5c00d46

View File

@ -1703,6 +1703,7 @@ impl Ident {
/// macro (e.g., `macro` or `macro_rules!` items) and stay different if they came from different /// macro (e.g., `macro` or `macro_rules!` items) and stay different if they came from different
/// non-transparent macros. /// non-transparent macros.
/// Technically, this operation strips all transparent marks from ident's syntactic context. /// Technically, this operation strips all transparent marks from ident's syntactic context.
#[inline]
pub fn normalize_to_macro_rules(self) -> Ident { pub fn normalize_to_macro_rules(self) -> Ident {
Ident::new(self.name, self.span.normalize_to_macro_rules()) Ident::new(self.name, self.span.normalize_to_macro_rules())
} }
@ -1718,6 +1719,7 @@ impl Ident {
} }
impl PartialEq for Ident { impl PartialEq for Ident {
#[inline]
fn eq(&self, rhs: &Self) -> bool { fn eq(&self, rhs: &Self) -> bool {
self.name == rhs.name && self.span.eq_ctxt(rhs.span) self.name == rhs.name && self.span.eq_ctxt(rhs.span)
} }