Use as_deref in compiler (but only where it makes sense)

This commit is contained in:
Maybe Waffle
2022-11-16 21:58:58 +00:00
parent e702534763
commit 94470f4efd
27 changed files with 45 additions and 63 deletions

View File

@@ -1354,7 +1354,7 @@ pub fn build_session(
let profiler = SelfProfiler::new(
directory,
sopts.crate_name.as_deref(),
sopts.unstable_opts.self_profile_events.as_ref().map(|xs| &xs[..]),
sopts.unstable_opts.self_profile_events.as_deref(),
&sopts.unstable_opts.self_profile_counter,
);
match profiler {
@@ -1388,7 +1388,7 @@ pub fn build_session(
local_crate_source_file.map(|path| file_path_mapping.map_prefix(path).0);
let optimization_fuel = Lock::new(OptimizationFuel {
remaining: sopts.unstable_opts.fuel.as_ref().map_or(0, |i| i.1),
remaining: sopts.unstable_opts.fuel.as_ref().map_or(0, |&(_, i)| i),
out_of_fuel: false,
});
let print_fuel = AtomicU64::new(0);