@@ -120,7 +120,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
120
120
fn check_trait_items ( cx : & LateContext < ' _ , ' _ > , visited_trait : & Item , trait_items : & [ TraitItemRef ] ) {
121
121
fn is_named_self ( cx : & LateContext < ' _ , ' _ > , item : & TraitItemRef , name : & str ) -> bool {
122
122
item. ident . name . as_str ( ) == name
123
- && if let AssociatedItemKind :: Method { has_self } = item. kind {
123
+ && if let AssocItemKind :: Method { has_self } = item. kind {
124
124
has_self && {
125
125
let did = cx. tcx . hir ( ) . local_def_id_from_hir_id ( item. id . hir_id ) ;
126
126
cx. tcx . fn_sig ( did) . inputs ( ) . skip_binder ( ) . len ( ) == 1
@@ -148,7 +148,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
148
148
. iter ( )
149
149
. flat_map ( |& i| cx. tcx . associated_items ( i) )
150
150
. any ( |i| {
151
- i. kind == ty:: AssociatedKind :: Method
151
+ i. kind == ty:: AssocKind :: Method
152
152
&& i. method_has_self_argument
153
153
&& i. ident . name == sym ! ( is_empty)
154
154
&& cx. tcx . fn_sig ( i. def_id ) . inputs ( ) . skip_binder ( ) . len ( ) == 1
@@ -171,7 +171,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
171
171
fn check_impl_items ( cx : & LateContext < ' _ , ' _ > , item : & Item , impl_items : & [ ImplItemRef ] ) {
172
172
fn is_named_self ( cx : & LateContext < ' _ , ' _ > , item : & ImplItemRef , name : & str ) -> bool {
173
173
item. ident . name . as_str ( ) == name
174
- && if let AssociatedItemKind :: Method { has_self } = item. kind {
174
+ && if let AssocItemKind :: Method { has_self } = item. kind {
175
175
has_self && {
176
176
let did = cx. tcx . hir ( ) . local_def_id_from_hir_id ( item. id . hir_id ) ;
177
177
cx. tcx . fn_sig ( did) . inputs ( ) . skip_binder ( ) . len ( ) == 1
@@ -258,9 +258,9 @@ fn check_len(
258
258
259
259
/// Checks if this type has an `is_empty` method.
260
260
fn has_is_empty ( cx : & LateContext < ' _ , ' _ > , expr : & Expr ) -> bool {
261
- /// Gets an `AssociatedItem ` and return true if it matches `is_empty(self)`.
262
- fn is_is_empty ( cx : & LateContext < ' _ , ' _ > , item : & ty:: AssociatedItem ) -> bool {
263
- if let ty:: AssociatedKind :: Method = item. kind {
261
+ /// Gets an `AssocItem ` and return true if it matches `is_empty(self)`.
262
+ fn is_is_empty ( cx : & LateContext < ' _ , ' _ > , item : & ty:: AssocItem ) -> bool {
263
+ if let ty:: AssocKind :: Method = item. kind {
264
264
if item. ident . name . as_str ( ) == "is_empty" {
265
265
let sig = cx. tcx . fn_sig ( item. def_id ) ;
266
266
let ty = sig. skip_binder ( ) ;
0 commit comments