aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/change.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-09 10:35:17 +0000
committerGitHub <[email protected]>2020-01-09 10:35:17 +0000
commit0d6e5a986cc7c3a434c2107edf748d1c26ac3f69 (patch)
treec5adb573c201abf473370c947e714c8d9cd129ff /crates/ra_ide/src/change.rs
parent5ced6f4be31576849f37e15c150f3ca3eea37b4d (diff)
parentd761435ba006227bc1a83f8450cfde000dac5aa3 (diff)
Merge #2771
2771: Remove the Default impl for SourceRoot r=matklad a=michalt Let's be always explicit whether we create a library (i.e., an immutable dependency) or a local `SourceRoot`, since it can have a large impact on the validation performance in salsa. (we found it the hard way recently, where the `Default` instance made it quite tricky to spot a bug) Signed-off-by: Michal Terepeta <[email protected]> Co-authored-by: Michal Terepeta <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/change.rs')
-rw-r--r--crates/ra_ide/src/change.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide/src/change.rs b/crates/ra_ide/src/change.rs
index 8b197d642..b0aa2c8e0 100644
--- a/crates/ra_ide/src/change.rs
+++ b/crates/ra_ide/src/change.rs
@@ -176,7 +176,8 @@ impl RootDatabase {
176 if !change.new_roots.is_empty() { 176 if !change.new_roots.is_empty() {
177 let mut local_roots = Vec::clone(&self.local_roots()); 177 let mut local_roots = Vec::clone(&self.local_roots());
178 for (root_id, is_local) in change.new_roots { 178 for (root_id, is_local) in change.new_roots {
179 let root = if is_local { SourceRoot::new() } else { SourceRoot::new_library() }; 179 let root =
180 if is_local { SourceRoot::new_local() } else { SourceRoot::new_library() };
180 let durability = durability(&root); 181 let durability = durability(&root);
181 self.set_source_root_with_durability(root_id, Arc::new(root), durability); 182 self.set_source_root_with_durability(root_id, Arc::new(root), durability);
182 if is_local { 183 if is_local {