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

@ -174,7 +174,7 @@ impl CoverageMapGenerator {
counter_regions.sort_unstable_by_key(|(_counter, region)| *region);
for (counter, region) in counter_regions {
let CodeRegion { file_name, start_line, start_col, end_line, end_col } = *region;
let same_file = current_file_name.as_ref().map_or(false, |p| *p == file_name);
let same_file = current_file_name.map_or(false, |p| p == file_name);
if !same_file {
if current_file_name.is_some() {
current_file_id += 1;