Fix clippy::manual_map
lint violations (#36584)
#36577 Release Notes: - N/A
This commit is contained in:
parent
de12633591
commit
bc79076ad3
18 changed files with 62 additions and 118 deletions
|
@ -2595,11 +2595,9 @@ impl LspCommand for GetCodeActions {
|
|||
server_id: LanguageServerId,
|
||||
cx: AsyncApp,
|
||||
) -> Result<Vec<CodeAction>> {
|
||||
let requested_kinds_set = if let Some(kinds) = self.kinds {
|
||||
Some(kinds.into_iter().collect::<HashSet<_>>())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let requested_kinds_set = self
|
||||
.kinds
|
||||
.map(|kinds| kinds.into_iter().collect::<HashSet<_>>());
|
||||
|
||||
let language_server = cx.update(|cx| {
|
||||
lsp_store
|
||||
|
@ -3821,12 +3819,11 @@ impl GetDocumentDiagnostics {
|
|||
_ => None,
|
||||
},
|
||||
code,
|
||||
code_description: match diagnostic.code_description {
|
||||
Some(code_description) => Some(CodeDescription {
|
||||
code_description: diagnostic
|
||||
.code_description
|
||||
.map(|code_description| CodeDescription {
|
||||
href: Some(lsp::Url::parse(&code_description).unwrap()),
|
||||
}),
|
||||
None => None,
|
||||
},
|
||||
related_information: Some(related_information),
|
||||
tags: Some(tags),
|
||||
source: diagnostic.source.clone(),
|
||||
|
|
|
@ -12270,11 +12270,10 @@ async fn populate_labels_for_completions(
|
|||
let lsp_completions = new_completions
|
||||
.iter()
|
||||
.filter_map(|new_completion| {
|
||||
if let Some(lsp_completion) = new_completion.source.lsp_completion(true) {
|
||||
Some(lsp_completion.into_owned())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
new_completion
|
||||
.source
|
||||
.lsp_completion(true)
|
||||
.map(|lsp_completion| lsp_completion.into_owned())
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
@ -12294,11 +12293,7 @@ async fn populate_labels_for_completions(
|
|||
for completion in new_completions {
|
||||
match completion.source.lsp_completion(true) {
|
||||
Some(lsp_completion) => {
|
||||
let documentation = if let Some(docs) = lsp_completion.documentation.clone() {
|
||||
Some(docs.into())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let documentation = lsp_completion.documentation.clone().map(|docs| docs.into());
|
||||
|
||||
let mut label = labels.next().flatten().unwrap_or_else(|| {
|
||||
CodeLabel::fallback_for_completion(&lsp_completion, language.as_deref())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue