]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/types.rs
Rollup merge of #82033 - magurotuna:issue82016, r=jyn514
[rust.git] / src / librustdoc / clean / types.rs
index 9b8e04a1d239de7ffb9eca4ffebeba921ad4fce2..e1ccbfd9da9deb7c4941cabbf4c587660fbc9dd9 100644 (file)
@@ -438,7 +438,7 @@ fn lists(&self, name: Symbol) -> ListAttributesIter<'_> {
 crate trait NestedAttributesExt {
     /// Returns `true` if the attribute list contains a specific `Word`
     fn has_word(self, word: Symbol) -> bool;
-    fn get_word_attr(self, word: Symbol) -> (Option<ast::NestedMetaItem>, bool);
+    fn get_word_attr(self, word: Symbol) -> Option<ast::NestedMetaItem>;
 }
 
 impl<I: Iterator<Item = ast::NestedMetaItem> + IntoIterator<Item = ast::NestedMetaItem>>
@@ -448,11 +448,8 @@ fn has_word(self, word: Symbol) -> bool {
         self.into_iter().any(|attr| attr.is_word() && attr.has_name(word))
     }
 
-    fn get_word_attr(mut self, word: Symbol) -> (Option<ast::NestedMetaItem>, bool) {
-        match self.find(|attr| attr.is_word() && attr.has_name(word)) {
-            Some(a) => (Some(a), true),
-            None => (None, false),
-        }
+    fn get_word_attr(mut self, word: Symbol) -> Option<ast::NestedMetaItem> {
+        self.find(|attr| attr.is_word() && attr.has_name(word))
     }
 }