Switch to any from count when checking for non_exhaustive attribute.

This commit is contained in:
David Wood 2018-07-13 08:36:01 +01:00
parent 9527d6ade7
commit d0d33a0335
No known key found for this signature in database
GPG Key ID: 01760B4F9F53F154
1 changed files with 1 additions and 2 deletions

View File

@ -497,8 +497,7 @@ impl Item {
pub fn is_non_exhaustive(&self) -> bool {
self.attrs.other_attrs.iter()
.filter(|a| a.name().as_str() == "non_exhaustive")
.count() > 0
.any(|a| a.name().as_str() == "non_exhaustive")
}
/// Returns a documentation-level item type from the item.