about summary refs log tree commit diff
path: root/compiler/rustc_monomorphize/src/util.rs
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2022-02-15 05:58:25 +0100
committerest31 <MTest31@outlook.com>2022-02-16 22:43:39 +0100
commit60f969a4f24c44f4ec763027bfbfe1747ae876b6 (patch)
treed9295176131e87a872183451c85170d92c2eac2a /compiler/rustc_monomorphize/src/util.rs
parent3cfa4def7c87d571bd46d92fed608edf8fad236e (diff)
downloadrust-60f969a4f24c44f4ec763027bfbfe1747ae876b6.tar.gz
rust-60f969a4f24c44f4ec763027bfbfe1747ae876b6.zip
Adopt let_else in even more places
Diffstat (limited to 'compiler/rustc_monomorphize/src/util.rs')
-rw-r--r--compiler/rustc_monomorphize/src/util.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_monomorphize/src/util.rs b/compiler/rustc_monomorphize/src/util.rs
index 27540395c07..04baa01832b 100644
--- a/compiler/rustc_monomorphize/src/util.rs
+++ b/compiler/rustc_monomorphize/src/util.rs
@@ -8,13 +8,11 @@ use std::io::prelude::*;
 /// During the same compile all closures dump the information in the same file
 /// "closure_profile_XXXXX.csv", which is created in the directory where the compiler is invoked.
 crate fn dump_closure_profile<'tcx>(tcx: TyCtxt<'tcx>, closure_instance: Instance<'tcx>) {
-    let mut file = if let Ok(file) = OpenOptions::new()
+    let Ok(mut file) = OpenOptions::new()
         .create(true)
         .append(true)
         .open(&format!("closure_profile_{}.csv", std::process::id()))
-    {
-        file
-    } else {
+    else {
         eprintln!("Cound't open file for writing closure profile");
         return;
     };