Skip to content

Commit ddcb073

Browse files
author
Orion Gonzalez
committed
replace is_some() -> unwrap with if let
1 parent fbce03b commit ddcb073

File tree

1 file changed

+2
-6
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+2
-6
lines changed

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,8 @@ fn run_compiler(
463463
linker.link(sess, codegen_backend)?
464464
}
465465

466-
if sess.opts.unstable_opts.print_fuel.is_some() {
467-
eprintln!(
468-
"Fuel used by {}: {}",
469-
sess.opts.unstable_opts.print_fuel.as_ref().unwrap(),
470-
sess.print_fuel.load(Ordering::SeqCst)
471-
);
466+
if let Some(fuel) = sess.opts.unstable_opts.print_fuel.as_deref() {
467+
eprintln!("Fuel used by {}: {}", fuel, sess.print_fuel.load(Ordering::SeqCst));
472468
}
473469

474470
Ok(())

0 commit comments

Comments
 (0)