Skip to content

Commit

Permalink
use discriminant
Browse files Browse the repository at this point in the history
  • Loading branch information
neunenak committed Nov 2, 2024
1 parent b647045 commit 0716e62
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ impl<'src> AttributeSet<'src> {
}

pub(crate) fn contains(&self, target: AttributeDiscriminant) -> bool {
self.0.iter().any(|attr| {
let discriminant: AttributeDiscriminant = attr.into();
discriminant == target
})
self.0.iter().any(|attr| attr.discriminant() == target)
}

pub(crate) fn get(&self, discriminant: AttributeDiscriminant) -> Option<&Attribute<'src>> {
Expand Down

0 comments on commit 0716e62

Please sign in to comment.