1
1
mirror of https://github.com/casey/just.git synced 2024-11-22 10:26:26 +03:00

use discriminant

This commit is contained in:
Greg Shuflin 2024-11-01 19:30:35 -07:00
parent b64704592b
commit 0716e62761

View File

@ -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>> {