mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 18:58:41 +00:00
Only clone when required
This commit is contained in:
parent
06a883e32f
commit
748f57c16d
4 changed files with 14 additions and 14 deletions
|
@ -163,8 +163,8 @@ impl Vfs {
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if the id is not present in the `Vfs`.
|
||||
pub fn file_path(&self, file_id: FileId) -> VfsPath {
|
||||
self.interner.lookup(file_id).clone()
|
||||
pub fn file_path(&self, file_id: FileId) -> &VfsPath {
|
||||
self.interner.lookup(file_id)
|
||||
}
|
||||
|
||||
/// Returns an iterator over the stored ids and their corresponding paths.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue