mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Auto merge of #14630 - Veykril:arc, r=Veykril
internal: `Arc<String>` -> `Arc<str>`
This commit is contained in:
commit
1379b5fac7
18 changed files with 48 additions and 38 deletions
|
@ -269,7 +269,7 @@ impl GlobalState {
|
|||
String::from_utf8(bytes).ok().and_then(|text| {
|
||||
let (text, line_endings) = LineEndings::normalize(text);
|
||||
line_endings_map.insert(file.file_id, line_endings);
|
||||
Some(Arc::new(text))
|
||||
Some(Arc::from(text))
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
@ -440,6 +440,10 @@ impl GlobalStateSnapshot {
|
|||
ProjectWorkspace::DetachedFiles { .. } => None,
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn vfs_memory_usage(&self) -> usize {
|
||||
self.vfs.read().0.memory_usage()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn file_id_to_url(vfs: &vfs::Vfs, id: FileId) -> Url {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue