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:
bors[bot] 2020-05-23 11:24:28 +00:00 committed by GitHub
commit ca5e4596a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View file

@ -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<()> {

View file

@ -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;
}

View file

@ -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() {

View file

@ -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 })
}