mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Stop using an Arc when setting the file text
This commit is contained in:
parent
02b6c181dd
commit
0f43b55e83
11 changed files with 21 additions and 24 deletions
|
@ -115,14 +115,14 @@ fn file_text(db: &dyn SourceDatabaseExt, file_id: FileId) -> Arc<str> {
|
|||
}
|
||||
|
||||
pub trait SourceDatabaseExt2 {
|
||||
fn set_file_text(&mut self, file_id: FileId, text: Arc<str>) {
|
||||
fn set_file_text(&mut self, file_id: FileId, text: &str) {
|
||||
self.set_file_text_with_durability(file_id, text, Durability::LOW);
|
||||
}
|
||||
|
||||
fn set_file_text_with_durability(
|
||||
&mut self,
|
||||
file_id: FileId,
|
||||
text: Arc<str>,
|
||||
text: &str,
|
||||
durability: Durability,
|
||||
);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ impl<Db: ?Sized + SourceDatabaseExt> SourceDatabaseExt2 for Db {
|
|||
fn set_file_text_with_durability(
|
||||
&mut self,
|
||||
file_id: FileId,
|
||||
text: Arc<str>,
|
||||
text: &str,
|
||||
durability: Durability,
|
||||
) {
|
||||
let bytes = text.as_bytes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue