mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Minor, more orthogonal code
It's better to accept things as arguments rather than store them.
This commit is contained in:
parent
17f236c2b0
commit
076945e47c
4 changed files with 12 additions and 16 deletions
|
@ -98,7 +98,8 @@ pub(crate) fn check_edit_with_config(
|
|||
let mut actual = db.file_text(position.file_id).to_string();
|
||||
|
||||
let mut combined_edit = completion.text_edit().to_owned();
|
||||
if let Some(import_text_edit) = completion.import_to_add().and_then(|edit| edit.to_text_edit())
|
||||
if let Some(import_text_edit) =
|
||||
completion.import_to_add().and_then(|edit| edit.to_text_edit(config.merge))
|
||||
{
|
||||
combined_edit.union(import_text_edit).expect(
|
||||
"Failed to apply completion resolve changes: change ranges overlap, but should not",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue