Auto merge of #14630 - Veykril:arc, r=Veykril

internal: `Arc<String>` -> `Arc<str>`
This commit is contained in:
bors 2023-04-22 07:58:13 +00:00
commit 1379b5fac7
18 changed files with 48 additions and 38 deletions

View file

@ -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 {