if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r)

This commit is contained in:
Maybe Waffle
2023-02-15 11:43:41 +00:00
parent af3c8b2726
commit 8751fa1a9a
54 changed files with 159 additions and 281 deletions

View File

@@ -21,11 +21,7 @@ impl<'tcx> super::QueryTypeOp<'tcx> for DropckOutlives<'tcx> {
tcx: TyCtxt<'tcx>,
key: &ParamEnvAnd<'tcx, Self>,
) -> Option<Self::QueryResponse> {
if trivial_dropck_outlives(tcx, key.value.dropped_ty) {
Some(DropckOutlivesResult::default())
} else {
None
}
trivial_dropck_outlives(tcx, key.value.dropped_ty).then(DropckOutlivesResult::default)
}
fn perform_query(