aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop/handlers.rs
diff options
context:
space:
mode:
authorJeremy A. Kolb <[email protected]>2018-11-29 20:30:49 +0000
committerJeremy A. Kolb <[email protected]>2018-11-29 20:30:49 +0000
commitf32dc7135175c1e8a9ea81d7c18c21b2722f28c5 (patch)
tree7f63a507106e33d4c4b1282e901fbcecc4c30143 /crates/ra_lsp_server/src/main_loop/handlers.rs
parent70a7cb34ec18d30a680a73727e1d87a0a786dc44 (diff)
Clippy lints
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 27933a7ae..6d5622b15 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -384,7 +384,7 @@ pub fn handle_completion(
384 let completion_triggered_after_single_colon = { 384 let completion_triggered_after_single_colon = {
385 let mut res = false; 385 let mut res = false;
386 if let Some(ctx) = params.context { 386 if let Some(ctx) = params.context {
387 if ctx.trigger_character.unwrap_or(String::new()) == ":" { 387 if ctx.trigger_character.unwrap_or_default() == ":" {
388 let source_file = world.analysis().file_syntax(position.file_id); 388 let source_file = world.analysis().file_syntax(position.file_id);
389 let syntax = source_file.syntax(); 389 let syntax = source_file.syntax();
390 let text = syntax.text(); 390 let text = syntax.text();
@@ -567,10 +567,13 @@ pub fn handle_rename(world: ServerWorld, params: RenameParams) -> Result<Option<
567 let mut changes = HashMap::new(); 567 let mut changes = HashMap::new();
568 for r in refs { 568 for r in refs {
569 if let Ok(loc) = to_location(r.0, r.1, &world, &line_index) { 569 if let Ok(loc) = to_location(r.0, r.1, &world, &line_index) {
570 changes.entry(loc.uri).or_insert(Vec::new()).push(TextEdit { 570 changes
571 range: loc.range, 571 .entry(loc.uri)
572 new_text: params.new_name.clone(), 572 .or_insert_with(Vec::new)
573 }); 573 .push(TextEdit {
574 range: loc.range,
575 new_text: params.new_name.clone(),
576 });
574 } 577 }
575 } 578 }
576 579