mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
more idiomatic code
This commit is contained in:
parent
360167db16
commit
99e8499957
1 changed files with 6 additions and 5 deletions
|
@ -465,14 +465,15 @@ pub fn handle_rename(world: ServerWorld, params: RenameParams) -> Result<Option<
|
|||
.into());
|
||||
}
|
||||
|
||||
let change = world
|
||||
let optional_change = world
|
||||
.analysis()
|
||||
.rename(FilePosition { file_id, offset }, &*params.new_name)?;
|
||||
if change.is_none() {
|
||||
return Ok(None);
|
||||
}
|
||||
let change = match optional_change {
|
||||
None => return Ok(None),
|
||||
Some(it) => it,
|
||||
};
|
||||
|
||||
let source_change_req = change.unwrap().try_conv_with(&world)?;
|
||||
let source_change_req = change.try_conv_with(&world)?;
|
||||
|
||||
Ok(Some(source_change_req.workspace_edit))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue