1
Fork 0

Avoid an unnecessary allocation

This commit is contained in:
Oli Scherer 2023-01-16 14:27:33 +00:00
parent 44ef075aeb
commit 1355559367
5 changed files with 28 additions and 27 deletions

View file

@ -18,13 +18,7 @@ impl<'a> SpanUtils<'a> {
match &file.name {
FileName::Real(RealFileName::LocalPath(path)) => {
if path.is_absolute() {
self.sess
.source_map()
.path_mapping()
.map_prefix(path.into())
.0
.display()
.to_string()
self.sess.source_map().path_mapping().map_prefix(path).0.display().to_string()
} else {
self.sess
.opts