mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-17 02:08:30 +00:00
Merge #9129
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:
commit
1dbdac8f51
5 changed files with 5 additions and 5 deletions
|
@ -130,7 +130,7 @@ impl<'a> Ctx<'a> {
|
|||
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(),
|
||||
}
|
||||
};
|
||||
|
|
|
@ -567,7 +567,7 @@ impl<'a> CompletionContext<'a> {
|
|||
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()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue