Skip to content

Commit

Permalink
replace is_some() -> unwrap with if let
Browse files Browse the repository at this point in the history
  • Loading branch information
Orion Gonzalez committed Aug 28, 2024
1 parent fbce03b commit ddcb073
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit ddcb073

Please sign in to comment.