aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_assists/src/assist_context.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs
index 94286b497..bc5481494 100644
--- a/crates/ra_assists/src/assist_context.rs
+++ b/crates/ra_assists/src/assist_context.rs
@@ -181,7 +181,7 @@ impl Assists {
181 if !self.resolve { 181 if !self.resolve {
182 return None; 182 return None;
183 } 183 }
184 let mut director = AssistDirector::new(); 184 let mut director = AssistDirector::default();
185 f(&mut director); 185 f(&mut director);
186 let changes = director.finish(); 186 let changes = director.finish();
187 let file_edits: Vec<SourceFileEdit> = 187 let file_edits: Vec<SourceFileEdit> =
@@ -296,10 +296,6 @@ pub(crate) struct AssistDirector {
296} 296}
297 297
298impl AssistDirector { 298impl AssistDirector {
299 fn new() -> AssistDirector {
300 AssistDirector { builders: FxHashMap::default() }
301 }
302
303 pub(crate) fn perform(&mut self, file_id: FileId, f: impl FnOnce(&mut AssistBuilder)) { 299 pub(crate) fn perform(&mut self, file_id: FileId, f: impl FnOnce(&mut AssistBuilder)) {
304 let mut builder = self.builders.entry(file_id).or_insert(AssistBuilder::new(file_id)); 300 let mut builder = self.builders.entry(file_id).or_insert(AssistBuilder::new(file_id));
305 f(&mut builder); 301 f(&mut builder);
@@ -312,3 +308,9 @@ impl AssistDirector {
312 .collect::<Vec<SourceChange>>() 308 .collect::<Vec<SourceChange>>()
313 } 309 }
314} 310}
311
312impl Default for AssistDirector {
313 fn default() -> Self {
314 AssistDirector { builders: FxHashMap::default() }
315 }
316}