From 057730c4b1ab3d56d3f650b37b2245870941cbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 1 Aug 2020 19:20:44 +0200 Subject: [PATCH] fix clippy::len_zero: use is_empty() instead of comparing .len() to zero --- src/librustc_traits/chalk/db.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_traits/chalk/db.rs b/src/librustc_traits/chalk/db.rs index 715e5299a37..31b20e45191 100644 --- a/src/librustc_traits/chalk/db.rs +++ b/src/librustc_traits/chalk/db.rs @@ -379,7 +379,7 @@ impl<'tcx> chalk_solve::RustIrDatabase> for RustIrDatabase<'t ty::AdtKind::Struct | ty::AdtKind::Union => None, ty::AdtKind::Enum => { let constraint = self.tcx.adt_sized_constraint(adt_def.did); - if constraint.0.len() > 0 { unimplemented!() } else { Some(true) } + if !constraint.0.is_empty() { unimplemented!() } else { Some(true) } } }, _ => None, @@ -398,7 +398,7 @@ impl<'tcx> chalk_solve::RustIrDatabase> for RustIrDatabase<'t ty::AdtKind::Struct | ty::AdtKind::Union => None, ty::AdtKind::Enum => { let constraint = self.tcx.adt_sized_constraint(adt_def.did); - if constraint.0.len() > 0 { unimplemented!() } else { Some(true) } + if !constraint.0.is_empty() { unimplemented!() } else { Some(true) } } }, _ => None,