mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
remove unnecessary lazy evaluations
This commit is contained in:
parent
7530d76f00
commit
cc80c5bd07
31 changed files with 50 additions and 51 deletions
|
@ -228,7 +228,7 @@ fn completion_item(
|
|||
max_relevance: u32,
|
||||
item: CompletionItem,
|
||||
) {
|
||||
let insert_replace_support = config.insert_replace_support().then(|| tdpp.position);
|
||||
let insert_replace_support = config.insert_replace_support().then_some(tdpp.position);
|
||||
let mut additional_text_edits = Vec::new();
|
||||
|
||||
// LSP does not allow arbitrary edits in completion, so we have to do a
|
||||
|
@ -258,7 +258,7 @@ fn completion_item(
|
|||
text_edit.unwrap()
|
||||
};
|
||||
|
||||
let insert_text_format = item.is_snippet().then(|| lsp_types::InsertTextFormat::SNIPPET);
|
||||
let insert_text_format = item.is_snippet().then_some(lsp_types::InsertTextFormat::SNIPPET);
|
||||
let tags = item.deprecated().then(|| vec![lsp_types::CompletionItemTag::DEPRECATED]);
|
||||
let command = if item.trigger_call_info() && config.client_commands().trigger_parameter_hints {
|
||||
Some(command::trigger_parameter_hints())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue