about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/base.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-05-24 14:33:43 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-05-24 14:33:43 +0000
commit307799a711826294bc2b3e562cd87bf1e2ff28b4 (patch)
tree1aa6b91ab277015585998e92e9be35f80331d7a2 /compiler/rustc_codegen_cranelift/src/base.rs
parentfb0f74a8c9e8b8f488ec5894d5d314caebf4c662 (diff)
downloadrust-307799a711826294bc2b3e562cd87bf1e2ff28b4.tar.gz
rust-307799a711826294bc2b3e562cd87bf1e2ff28b4.zip
Use `is_some_and`/`is_ok_and` in less obvious spots
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/base.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index 25fd5ca3ae8..9c6a0fae327 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -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) {