mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Merge #4578
4578: Remove unnecessary clone that prevented clippy from moving on r=matklad a=kjeremy Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
ca5e4596a0
4 changed files with 5 additions and 7 deletions
|
@ -23,7 +23,7 @@ use crate::{AssistContext, AssistId, Assists};
|
|||
// ```
|
||||
//
|
||||
pub(crate) fn reorder_fields(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
|
||||
reorder::<ast::RecordLit>(acc, ctx.clone()).or_else(|| reorder::<ast::RecordPat>(acc, ctx))
|
||||
reorder::<ast::RecordLit>(acc, ctx).or_else(|| reorder::<ast::RecordPat>(acc, ctx))
|
||||
}
|
||||
|
||||
fn reorder<R: AstNode>(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
|
||||
|
|
|
@ -269,10 +269,8 @@ impl Config {
|
|||
{
|
||||
self.client_caps.hierarchical_symbols = value
|
||||
}
|
||||
if let Some(value) = doc_caps
|
||||
.code_action
|
||||
.as_ref()
|
||||
.and_then(|it| Some(it.code_action_literal_support.is_some()))
|
||||
if let Some(value) =
|
||||
doc_caps.code_action.as_ref().map(|it| it.code_action_literal_support.is_some())
|
||||
{
|
||||
self.client_caps.code_action_literals = value;
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ pub fn handle_document_symbol(
|
|||
kind: symbol.kind,
|
||||
deprecated: symbol.deprecated,
|
||||
location: Location::new(url.clone(), symbol.range),
|
||||
container_name: container_name,
|
||||
container_name,
|
||||
});
|
||||
|
||||
for child in symbol.children.iter().flatten() {
|
||||
|
|
|
@ -455,7 +455,7 @@ pub(crate) fn snippet_text_document_edit(
|
|||
let edits = source_file_edit
|
||||
.edit
|
||||
.into_iter()
|
||||
.map(|it| snippet_text_edit(&line_index, line_endings, is_snippet, it.clone()))
|
||||
.map(|it| snippet_text_edit(&line_index, line_endings, is_snippet, it))
|
||||
.collect();
|
||||
Ok(lsp_ext::SnippetTextDocumentEdit { text_document, edits })
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue