@@ -12,7 +12,7 @@ use crate::{CrateGraph, ProcMacros, SourceDatabaseExt, SourceRoot, SourceRootId}
1212#[ derive( Default ) ]
1313pub struct Change {
1414 pub roots : Option < Vec < SourceRoot > > ,
15- pub files_changed : Vec < ( FileId , Option < Arc < String > > ) > ,
15+ pub files_changed : Vec < ( FileId , Option < Arc < str > > ) > ,
1616 pub crate_graph : Option < CrateGraph > ,
1717 pub proc_macros : Option < ProcMacros > ,
1818}
@@ -42,7 +42,7 @@ impl Change {
4242 self . roots = Some ( roots) ;
4343 }
4444
45- pub fn change_file ( & mut self , file_id : FileId , new_text : Option < Arc < String > > ) {
45+ pub fn change_file ( & mut self , file_id : FileId , new_text : Option < Arc < str > > ) {
4646 self . files_changed . push ( ( file_id, new_text) )
4747 }
4848
@@ -72,7 +72,7 @@ impl Change {
7272 let source_root = db. source_root ( source_root_id) ;
7373 let durability = durability ( & source_root) ;
7474 // XXX: can't actually remove the file, just reset the text
75- let text = text. unwrap_or_default ( ) ;
75+ let text = text. unwrap_or_else ( || Arc :: from ( "" ) ) ;
7676 db. set_file_text_with_durability ( file_id, text, durability)
7777 }
7878 if let Some ( crate_graph) = self . crate_graph {
0 commit comments