1
Fork 0

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

@ -460,7 +460,7 @@ impl<'tcx> OnUnimplementedDirective {
info!("evaluate({:?}, trait_ref={:?}, options={:?})", self, trait_ref, options);
let options_map: FxHashMap<Symbol, String> =
options.iter().filter_map(|(k, v)| v.as_ref().map(|v| (*k, v.to_owned()))).collect();
options.iter().filter_map(|(k, v)| v.clone().map(|v| (*k, v))).collect();
for command in self.subcommands.iter().chain(Some(self)).rev() {
if let Some(ref condition) = command.condition && !attr::eval_condition(