From d0d33a03351433b7c27ae03e17bf18ad627379fe Mon Sep 17 00:00:00 2001 From: David Wood Date: Fri, 13 Jul 2018 08:36:01 +0100 Subject: [PATCH] Switch to any from count when checking for non_exhaustive attribute. --- src/librustdoc/clean/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index a47213a62a5..87f52d2cfa2 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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.