Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
krishna-veerareddy committed Feb 9, 2020
1 parent ab0cb30 commit 46bd185
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clippy_lints/src/len_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ fn has_is_empty(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
cx.tcx
.inherent_impls(id)
.iter()
.any(|imp| cx.tcx.associated_items(*imp).any(|item| is_is_empty(cx, &item)))
.any(|imp| cx.tcx.associated_items(*imp).iter().any(|item| is_is_empty(cx, &item)))
}

let ty = &walk_ptrs_ty(cx.tables.expr_ty(expr));
Expand All @@ -288,6 +288,7 @@ fn has_is_empty(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
if let Some(principal) = tt.principal() {
cx.tcx
.associated_items(principal.def_id())
.iter()
.any(|item| is_is_empty(cx, &item))
} else {
false
Expand Down
1 change: 1 addition & 0 deletions clippy_lints/src/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ fn check_trait_method_impl_decl<'a, 'tcx>(
let trait_method = cx
.tcx
.associated_items(impl_trait_ref.def_id)
.iter()
.find(|assoc_item| {
assoc_item.kind == ty::AssocKind::Method
&& cx
Expand Down

0 comments on commit 46bd185

Please sign in to comment.