Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 057730c

Browse files
committed
fix clippy::len_zero: use is_empty() instead of comparing .len() to zero
1 parent eccc2fe commit 057730c

File tree

1 file changed

+2
-2
lines changed
  • src/librustc_traits/chalk

1 file changed

+2
-2
lines changed

src/librustc_traits/chalk/db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
379379
ty::AdtKind::Struct | ty::AdtKind::Union => None,
380380
ty::AdtKind::Enum => {
381381
let constraint = self.tcx.adt_sized_constraint(adt_def.did);
382-
if constraint.0.len() > 0 { unimplemented!() } else { Some(true) }
382+
if !constraint.0.is_empty() { unimplemented!() } else { Some(true) }
383383
}
384384
},
385385
_ => None,
@@ -398,7 +398,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
398398
ty::AdtKind::Struct | ty::AdtKind::Union => None,
399399
ty::AdtKind::Enum => {
400400
let constraint = self.tcx.adt_sized_constraint(adt_def.did);
401-
if constraint.0.len() > 0 { unimplemented!() } else { Some(true) }
401+
if !constraint.0.is_empty() { unimplemented!() } else { Some(true) }
402402
}
403403
},
404404
_ => None,

0 commit comments

Comments
 (0)