File tree 2 files changed +5
-7
lines changed
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(
2163
2163
return Vec :: new ( ) ;
2164
2164
}
2165
2165
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 ( ) ;
2167
2168
let pub_underscore = import. vis . node . is_pub ( ) && name == kw:: Underscore ;
2168
2169
2169
2170
if pub_underscore && please_inline {
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ impl AttributesExt for [ast::Attribute] {
438
438
crate trait NestedAttributesExt {
439
439
/// Returns `true` if the attribute list contains a specific `Word`
440
440
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 > ;
442
442
}
443
443
444
444
impl < I : Iterator < Item = ast:: NestedMetaItem > + IntoIterator < Item = ast:: NestedMetaItem > >
@@ -448,11 +448,8 @@ impl<I: Iterator<Item = ast::NestedMetaItem> + IntoIterator<Item = ast::NestedMe
448
448
self . into_iter ( ) . any ( |attr| attr. is_word ( ) && attr. has_name ( word) )
449
449
}
450
450
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) )
456
453
}
457
454
}
458
455
You can’t perform that action at this time.
0 commit comments