Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/base-db/src/change.rs')
-rw-r--r--crates/base-db/src/change.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/base-db/src/change.rs b/crates/base-db/src/change.rs
index d709fde331..335c7840a6 100644
--- a/crates/base-db/src/change.rs
+++ b/crates/base-db/src/change.rs
@@ -13,7 +13,7 @@ use crate::{CrateGraph, SourceDatabaseExt, SourceDatabaseExt2, SourceRoot, Sourc
#[derive(Default)]
pub struct FileChange {
pub roots: Option<Vec<SourceRoot>>,
- pub files_changed: Vec<(FileId, Option<Arc<str>>)>,
+ pub files_changed: Vec<(FileId, Option<String>)>,
pub crate_graph: Option<CrateGraph>,
}
@@ -42,7 +42,7 @@ impl FileChange {
self.roots = Some(roots);
}
- pub fn change_file(&mut self, file_id: FileId, new_text: Option<Arc<str>>) {
+ pub fn change_file(&mut self, file_id: FileId, new_text: Option<String>) {
self.files_changed.push((file_id, new_text))
}
@@ -68,7 +68,7 @@ impl FileChange {
let source_root = db.source_root(source_root_id);
let durability = durability(&source_root);
// XXX: can't actually remove the file, just reset the text
- let text = text.unwrap_or_else(|| Arc::from(""));
+ let text = text.as_ref().map(String::as_str).unwrap_or_else(|| "");
db.set_file_text_with_durability(file_id, text, durability)
}
if let Some(crate_graph) = self.crate_graph {