Match against attribute name when validating attributes
Extract attribute name once and match it against symbols that are being validated, instead of using `Session::check_name` for each symbol individually. Assume that all validated attributes are used, instead of marking them as such, since the attribute check should be exhaustive.
This commit is contained in:
@@ -100,6 +100,7 @@ pub struct Path {
|
||||
}
|
||||
|
||||
impl PartialEq<Symbol> for Path {
|
||||
#[inline]
|
||||
fn eq(&self, symbol: &Symbol) -> bool {
|
||||
self.segments.len() == 1 && { self.segments[0].ident.name == *symbol }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user