Use is_some_and/is_ok_and in less obvious spots

This commit is contained in:
Maybe Waffle 2023-05-24 14:33:43 +00:00
parent fb0f74a8c9
commit 307799a711
19 changed files with 53 additions and 88 deletions

View file

@ -630,11 +630,11 @@ fn codegen_stmt<'tcx>(
let to_ty = fx.monomorphize(to_ty);
fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
ty.builtin_deref(true)
.map(|ty::TypeAndMut { ty: pointee_ty, mutbl: _ }| {
ty.builtin_deref(true).is_some_and(
|ty::TypeAndMut { ty: pointee_ty, mutbl: _ }| {
has_ptr_meta(fx.tcx, pointee_ty)
})
.unwrap_or(false)
},
)
}
if is_fat_ptr(fx, from_ty) {