about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/util/alignment.rs
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2022-02-19 00:47:43 +0100
committerest31 <MTest31@outlook.com>2022-02-19 01:55:47 +0100
commit5cc292eb1dcb22bd6a46478165b5820f8177c87f (patch)
tree28d4d27bd86d09f53475cd9d55afc730cc21fcb6 /compiler/rustc_const_eval/src/util/alignment.rs
parentb8c56fa8c30821129b0960180f528d4a1a4f9316 (diff)
downloadrust-5cc292eb1dcb22bd6a46478165b5820f8177c87f.tar.gz
rust-5cc292eb1dcb22bd6a46478165b5820f8177c87f.zip
rustc_const_eval: adopt let else in more places
Diffstat (limited to 'compiler/rustc_const_eval/src/util/alignment.rs')
-rw-r--r--compiler/rustc_const_eval/src/util/alignment.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_const_eval/src/util/alignment.rs b/compiler/rustc_const_eval/src/util/alignment.rs
index 73adc60577b..e4528b68907 100644
--- a/compiler/rustc_const_eval/src/util/alignment.rs
+++ b/compiler/rustc_const_eval/src/util/alignment.rs
@@ -15,12 +15,9 @@ where
     L: HasLocalDecls<'tcx>,
 {
     debug!("is_disaligned({:?})", place);
-    let pack = match is_within_packed(tcx, local_decls, place) {
-        None => {
-            debug!("is_disaligned({:?}) - not within packed", place);
-            return false;
-        }
-        Some(pack) => pack,
+    let Some(pack) = is_within_packed(tcx, local_decls, place) else {
+        debug!("is_disaligned({:?}) - not within packed", place);
+        return false;
     };
 
     let ty = place.ty(local_decls, tcx).ty;