aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorgfreezy <[email protected]>2019-01-18 08:32:36 +0000
committerAleksey Kladov <[email protected]>2019-01-19 12:36:58 +0000
commit99e84999574ec522c07a864e5734b5f1311768cb (patch)
tree523d7fb850362c4e5f14ac77a9fa038d37f97105 /crates
parent360167db16a3ae6bb3146cf8e05336288b711921 (diff)
more idiomatic code
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs11
1 files changed, 6 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 9cdca82c4..8f9db68a2 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -465,14 +465,15 @@ pub fn handle_rename(world: ServerWorld, params: RenameParams) -> Result<Option<
465 .into()); 465 .into());
466 } 466 }
467 467
468 let change = world 468 let optional_change = world
469 .analysis() 469 .analysis()
470 .rename(FilePosition { file_id, offset }, &*params.new_name)?; 470 .rename(FilePosition { file_id, offset }, &*params.new_name)?;
471 if change.is_none() { 471 let change = match optional_change {
472 return Ok(None); 472 None => return Ok(None),
473 } 473 Some(it) => it,
474 };
474 475
475 let source_change_req = change.unwrap().try_conv_with(&world)?; 476 let source_change_req = change.try_conv_with(&world)?;
476 477
477 Ok(Some(source_change_req.workspace_edit)) 478 Ok(Some(source_change_req.workspace_edit))
478} 479}