This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -2163,7 +2163,8 @@ fn clean_use_statement(
21632163 return Vec :: new ( ) ;
21642164 }
21652165
2166- let ( doc_meta_item, please_inline) = import. attrs . lists ( sym:: doc) . get_word_attr ( sym:: inline) ;
2166+ let doc_meta_item = import. attrs . lists ( sym:: doc) . get_word_attr ( sym:: inline) ;
2167+ let please_inline = doc_meta_item. is_some ( ) ;
21672168 let pub_underscore = import. vis . node . is_pub ( ) && name == kw:: Underscore ;
21682169
21692170 if pub_underscore && please_inline {
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ impl AttributesExt for [ast::Attribute] {
438438crate trait NestedAttributesExt {
439439 /// Returns `true` if the attribute list contains a specific `Word`
440440 fn has_word ( self , word : Symbol ) -> bool ;
441- fn get_word_attr ( self , word : Symbol ) -> ( Option < ast:: NestedMetaItem > , bool ) ;
441+ fn get_word_attr ( self , word : Symbol ) -> Option < ast:: NestedMetaItem > ;
442442}
443443
444444impl < I : Iterator < Item = ast:: NestedMetaItem > + IntoIterator < Item = ast:: NestedMetaItem > >
@@ -448,11 +448,8 @@ impl<I: Iterator<Item = ast::NestedMetaItem> + IntoIterator<Item = ast::NestedMe
448448 self . into_iter ( ) . any ( |attr| attr. is_word ( ) && attr. has_name ( word) )
449449 }
450450
451- fn get_word_attr ( mut self , word : Symbol ) -> ( Option < ast:: NestedMetaItem > , bool ) {
452- match self . find ( |attr| attr. is_word ( ) && attr. has_name ( word) ) {
453- Some ( a) => ( Some ( a) , true ) ,
454- None => ( None , false ) ,
455- }
451+ fn get_word_attr ( mut self , word : Symbol ) -> Option < ast:: NestedMetaItem > {
452+ self . find ( |attr| attr. is_word ( ) && attr. has_name ( word) )
456453 }
457454}
458455
You can’t perform that action at this time.
0 commit comments