1
- // ignore-tidy-filelength
2
-
3
1
use std:: fmt;
4
2
use std:: hash:: { Hash , Hasher } ;
5
3
use std:: default:: Default ;
@@ -88,7 +86,6 @@ pub struct Item {
88
86
89
87
impl fmt:: Debug for Item {
90
88
fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
91
-
92
89
let fake = MAX_DEF_ID . with ( |m| m. borrow ( ) . get ( & self . def_id . krate )
93
90
. map ( |id| self . def_id >= * id) . unwrap_or ( false ) ) ;
94
91
let def_id: & dyn fmt:: Debug = if fake { & "**FAKE**" } else { & self . def_id } ;
@@ -112,6 +109,7 @@ impl Item {
112
109
pub fn doc_value ( & self ) -> Option < & str > {
113
110
self . attrs . doc_value ( )
114
111
}
112
+
115
113
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
116
114
/// with newlines.
117
115
pub fn collapsed_doc_value ( & self ) -> Option < String > {
@@ -174,7 +172,6 @@ impl Item {
174
172
pub fn is_keyword ( & self ) -> bool {
175
173
self . type_ ( ) == ItemType :: Keyword
176
174
}
177
-
178
175
pub fn is_stripped ( & self ) -> bool {
179
176
match self . inner { StrippedItem ( ..) => true , _ => false }
180
177
}
@@ -456,9 +453,7 @@ impl Attributes {
456
453
/// Reads a `MetaItem` from within an attribute, looks for whether it is a
457
454
/// `#[doc(include="file")]`, and returns the filename and contents of the file as loaded from
458
455
/// its expansion.
459
- pub fn extract_include ( mi : & ast:: MetaItem )
460
- -> Option < ( String , String ) >
461
- {
456
+ pub fn extract_include ( mi : & ast:: MetaItem ) -> Option < ( String , String ) > {
462
457
mi. meta_item_list ( ) . and_then ( |list| {
463
458
for meta in list {
464
459
if meta. check_name ( sym:: include) {
@@ -508,8 +503,7 @@ impl Attributes {
508
503
false
509
504
}
510
505
511
- pub fn from_ast ( diagnostic : & :: errors:: Handler ,
512
- attrs : & [ ast:: Attribute ] ) -> Attributes {
506
+ pub fn from_ast ( diagnostic : & :: errors:: Handler , attrs : & [ ast:: Attribute ] ) -> Attributes {
513
507
let mut doc_strings = vec ! [ ] ;
514
508
let mut sp = None ;
515
509
let mut cfg = Cfg :: True ;
@@ -520,7 +514,7 @@ impl Attributes {
520
514
/// returns `attr` unchanged.
521
515
pub fn with_doc_comment_markers_stripped < T > (
522
516
attr : & Attribute ,
523
- f : impl FnOnce ( & Attribute ) -> T
517
+ f : impl FnOnce ( & Attribute ) -> T ,
524
518
) -> T {
525
519
match attr. kind {
526
520
AttrKind :: Normal ( _) => {
@@ -823,7 +817,6 @@ impl GenericParamDefKind {
823
817
#[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
824
818
pub struct GenericParamDef {
825
819
pub name : String ,
826
-
827
820
pub kind : GenericParamDefKind ,
828
821
}
829
822
0 commit comments