From 1b286b128b529d558f92f8dda39ae72759c3fa15 Mon Sep 17 00:00:00 2001 From: Caio Date: Sun, 12 Feb 2023 16:17:37 -0300 Subject: [PATCH] Address comments --- .../src/significant_drop_tightening.rs | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/clippy_lints/src/significant_drop_tightening.rs b/clippy_lints/src/significant_drop_tightening.rs index a509592a1..4cc85e385 100644 --- a/clippy_lints/src/significant_drop_tightening.rs +++ b/clippy_lints/src/significant_drop_tightening.rs @@ -273,12 +273,12 @@ impl<'cx, 'sdt, 'tcx> SigDropChecker<'cx, 'sdt, 'tcx> { pub(crate) fn has_sig_drop_attr(&mut self, ty: Ty<'tcx>) -> bool { if let Some(adt) = ty.ty_adt_def() { - let iter = get_attr( + let mut iter = get_attr( self.cx.sess(), self.cx.tcx.get_attrs_unchecked(adt.did()), "has_significant_drop", ); - if iter.count() > 0 { + if iter.next().is_some() { return true; } } @@ -360,22 +360,7 @@ impl<'cx, 'sdt, 'tcx> Visitor<'tcx> for SigDropFinder<'cx, 'sdt, 'tcx> { | hir::ExprKind::Yield(..) => { walk_expr(self, ex); }, - hir::ExprKind::AddrOf(_, _, _) - | hir::ExprKind::Block(_, _) - | hir::ExprKind::Break(_, _) - | hir::ExprKind::Cast(_, _) - | hir::ExprKind::Closure { .. } - | hir::ExprKind::ConstBlock(_) - | hir::ExprKind::Continue(_) - | hir::ExprKind::DropTemps(_) - | hir::ExprKind::Err - | hir::ExprKind::InlineAsm(_) - | hir::ExprKind::Let(_) - | hir::ExprKind::Lit(_) - | hir::ExprKind::Loop(_, _, _, _) - | hir::ExprKind::Path(_) - | hir::ExprKind::Struct(_, _, _) - | hir::ExprKind::Type(_, _) => {}, + _ => {}, } } }