1
Fork 0

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

@ -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(),
}
}