Avoid an unnecessary allocation
This commit is contained in:
parent
44ef075aeb
commit
1355559367
5 changed files with 28 additions and 27 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue