about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorOrion Gonzalez <ardi@ardis.dev>2024-08-27 18:28:59 +0200
committerOrion Gonzalez <ardi@ardis.dev>2024-08-28 13:03:15 +0200
commitddcb073c53db68500e31874529595e6c7658b670 (patch)
tree92599a593bdac917e40ab17f8b10ed94f3f43252 /compiler/rustc_driver_impl/src
parentfbce03b195c02e425fbb12276b8f02349048a75f (diff)
downloadrust-ddcb073c53db68500e31874529595e6c7658b670.tar.gz
rust-ddcb073c53db68500e31874529595e6c7658b670.zip
replace is_some() -> unwrap with if let
Diffstat (limited to 'compiler/rustc_driver_impl/src')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 2b7dc040f64..540523aa7b4 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -463,12 +463,8 @@ fn run_compiler(
             linker.link(sess, codegen_backend)?
         }
 
-        if sess.opts.unstable_opts.print_fuel.is_some() {
-            eprintln!(
-                "Fuel used by {}: {}",
-                sess.opts.unstable_opts.print_fuel.as_ref().unwrap(),
-                sess.print_fuel.load(Ordering::SeqCst)
-            );
+        if let Some(fuel) = sess.opts.unstable_opts.print_fuel.as_deref() {
+            eprintln!("Fuel used by {}: {}", fuel, sess.print_fuel.load(Ordering::SeqCst));
         }
 
         Ok(())