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:
parent
ba6275b6a9
commit
985ae0b55b
3 changed files with 46 additions and 52 deletions
|
@ -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 }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue