diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-16 21:58:58 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-16 21:58:58 +0000 |
| commit | 94470f4efd2ec0786dd1f201e9ea84651b4bb0d0 (patch) | |
| tree | 1bcf415fa3d0bedc9b223162446ab9653c8f5bec /compiler/rustc_span/src | |
| parent | e702534763599db252f2ca308739ec340d0933de (diff) | |
| download | rust-94470f4efd2ec0786dd1f201e9ea84651b4bb0d0.tar.gz rust-94470f4efd2ec0786dd1f201e9ea84651b4bb0d0.zip | |
Use `as_deref` in compiler (but only where it makes sense)
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 322c7104be4..7ccfa600ec3 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -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(), } } |
