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:
commit
872631d0f0
27 changed files with 45 additions and 63 deletions
|
@ -217,9 +217,7 @@ impl RealFileName {
|
|||
pub fn local_path(&self) -> Option<&Path> {
|
||||
match self {
|
||||
RealFileName::LocalPath(p) => Some(p),
|
||||
RealFileName::Remapped { local_path: p, virtual_name: _ } => {
|
||||
p.as_ref().map(PathBuf::as_path)
|
||||
}
|
||||
RealFileName::Remapped { local_path, virtual_name: _ } => local_path.as_deref(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue