Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser

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

This simplifies some code :3

(there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
This commit is contained in:
bors 2022-11-24 00:17:35 +00:00
commit 872631d0f0
27 changed files with 45 additions and 63 deletions

View file

@ -318,7 +318,7 @@ fn run_compiler(
compiler.input(),
&*expanded_crate,
*ppm,
compiler.output_file().as_ref().map(|p| &**p),
compiler.output_file().as_deref(),
);
Ok(())
})?;
@ -329,7 +329,7 @@ fn run_compiler(
compiler.input(),
&krate,
*ppm,
compiler.output_file().as_ref().map(|p| &**p),
compiler.output_file().as_deref(),
);
}
trace!("finished pretty-printing");
@ -383,10 +383,7 @@ fn run_compiler(
&crate_name,
compiler.input(),
None,
DumpHandler::new(
compiler.output_dir().as_ref().map(|p| &**p),
&crate_name,
),
DumpHandler::new(compiler.output_dir().as_deref(), &crate_name),
)
});
}