replace is_some() -> unwrap with if let

This commit is contained in:
Orion Gonzalez 2024-08-27 18:28:59 +02:00
parent fbce03b195
commit ddcb073c53

View File

@ -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(())