@@ -67,19 +67,17 @@ declare_clippy_lint! {
67
67
68
68
pub struct MissingInline ;
69
69
70
- impl MissingInline {
71
- fn check_missing_inline_attrs ( & self , cx : & LateContext ,
72
- attrs : & [ ast:: Attribute ] , sp : Span , desc : & ' static str ) {
73
- let has_inline = attrs
74
- . iter ( )
75
- . any ( |a| a. name ( ) == "inline" ) ;
76
- if !has_inline {
77
- cx. span_lint (
78
- MISSING_INLINE_IN_PUBLIC_ITEMS ,
79
- sp,
80
- & format ! ( "missing `#[inline]` for {}" , desc) ,
81
- ) ;
82
- }
70
+ fn check_missing_inline_attrs ( cx : & LateContext ,
71
+ attrs : & [ ast:: Attribute ] , sp : Span , desc : & ' static str ) {
72
+ let has_inline = attrs
73
+ . iter ( )
74
+ . any ( |a| a. name ( ) == "inline" ) ;
75
+ if !has_inline {
76
+ cx. span_lint (
77
+ MISSING_INLINE_IN_PUBLIC_ITEMS ,
78
+ sp,
79
+ & format ! ( "missing `#[inline]` for {}" , desc) ,
80
+ ) ;
83
81
}
84
82
}
85
83
@@ -112,7 +110,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
112
110
match it. node {
113
111
hir:: ItemFn ( ..) => {
114
112
let desc = "a function" ;
115
- self . check_missing_inline_attrs ( cx, & it. attrs , it. span , desc) ;
113
+ check_missing_inline_attrs ( cx, & it. attrs , it. span , desc) ;
116
114
} ,
117
115
hir:: ItemTrait ( ref _is_auto, ref _unsafe, ref _generics,
118
116
ref _bounds, ref trait_items) => {
@@ -129,7 +127,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
129
127
// an impl is not provided
130
128
let desc = "a default trait method" ;
131
129
let item = cx. tcx . hir . expect_trait_item ( tit. id . node_id ) ;
132
- self . check_missing_inline_attrs ( cx, & item. attrs ,
130
+ check_missing_inline_attrs ( cx, & item. attrs ,
133
131
item. span , desc) ;
134
132
}
135
133
} ,
@@ -195,6 +193,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingInline {
195
193
} ,
196
194
}
197
195
198
- self . check_missing_inline_attrs ( cx, & impl_item. attrs , impl_item. span , desc) ;
196
+ check_missing_inline_attrs ( cx, & impl_item. attrs , impl_item. span , desc) ;
199
197
}
200
198
}
0 commit comments