9129: NFC: remove redundant clones (clippy::perf) r=Veykril a=matthiaskrgr



Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
This commit is contained in:
bors[bot]
2021-06-03 13:45:17 +00:00
committed by GitHub
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ fn lower_mod_item(&mut self, item: &ast::Item, inner: bool) -> Option<ModItem> {
ast::Item::ExternBlock(ast) => self.lower_extern_block(ast).into(),
};
self.add_attrs(item.into(), attrs.clone());
self.add_attrs(item.into(), attrs);
Some(item)
}
@@ -31,7 +31,7 @@ pub(crate) fn extract_type_alias(acc: &mut Assists, ctx: &AssistContext) -> Opti
let item = ctx.find_node_at_offset::<ast::Item>()?;
let insert = match_ast! {
match (item.syntax().parent()?) {
ast::AssocItemList(it) => it.syntax().parent()?.clone(),
ast::AssocItemList(it) => it.syntax().parent()?,
_ => item.syntax().clone(),
}
};
+1 -1
View File
@@ -567,7 +567,7 @@ fn classify_name_ref(&mut self, original_file: &SyntaxNode, name_ref: ast::NameR
None => return,
};
if let Some(segment) = ast::PathSegment::cast(parent.clone()) {
if let Some(segment) = ast::PathSegment::cast(parent) {
let path = segment.parent_path();
self.is_call = path
.syntax()
+1 -1
View File
@@ -92,7 +92,7 @@ fn read_json<'a>(
// Some ill behaved macro try to use stdout for debugging
// We ignore it here
if !buf.starts_with("{") {
if !buf.starts_with('{') {
log::error!("proc-macro tried to print : {}", buf);
continue;
}
+1 -1
View File
@@ -1640,7 +1640,7 @@ fn run_rustfmt(
.into());
}
let frange = from_proto::file_range(&snap, text_document.clone(), range)?;
let frange = from_proto::file_range(&snap, text_document, range)?;
let start_line = line_index.index.line_col(frange.range.start()).line;
let end_line = line_index.index.line_col(frange.range.end()).line;