Skip to content

Commit ca5e459

Browse files
bors[bot]kjeremy
andauthored
Merge #4578
4578: Remove unnecessary clone that prevented clippy from moving on r=matklad a=kjeremy Co-authored-by: kjeremy <[email protected]>
2 parents 88c292b + 7a46a99 commit ca5e459

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

crates/ra_assists/src/handlers/reorder_fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::{AssistContext, AssistId, Assists};
2323
// ```
2424
//
2525
pub(crate) fn reorder_fields(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
26-
reorder::<ast::RecordLit>(acc, ctx.clone()).or_else(|| reorder::<ast::RecordPat>(acc, ctx))
26+
reorder::<ast::RecordLit>(acc, ctx).or_else(|| reorder::<ast::RecordPat>(acc, ctx))
2727
}
2828

2929
fn reorder<R: AstNode>(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {

crates/rust-analyzer/src/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,8 @@ impl Config {
269269
{
270270
self.client_caps.hierarchical_symbols = value
271271
}
272-
if let Some(value) = doc_caps
273-
.code_action
274-
.as_ref()
275-
.and_then(|it| Some(it.code_action_literal_support.is_some()))
272+
if let Some(value) =
273+
doc_caps.code_action.as_ref().map(|it| it.code_action_literal_support.is_some())
276274
{
277275
self.client_caps.code_action_literals = value;
278276
}

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub fn handle_document_symbol(
281281
kind: symbol.kind,
282282
deprecated: symbol.deprecated,
283283
location: Location::new(url.clone(), symbol.range),
284-
container_name: container_name,
284+
container_name,
285285
});
286286

287287
for child in symbol.children.iter().flatten() {

crates/rust-analyzer/src/to_proto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ pub(crate) fn snippet_text_document_edit(
455455
let edits = source_file_edit
456456
.edit
457457
.into_iter()
458-
.map(|it| snippet_text_edit(&line_index, line_endings, is_snippet, it.clone()))
458+
.map(|it| snippet_text_edit(&line_index, line_endings, is_snippet, it))
459459
.collect();
460460
Ok(lsp_ext::SnippetTextDocumentEdit { text_document, edits })
461461
}

0 commit comments

Comments
 (0)