diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs index 0e467d9071..cfda7cb321 100644 --- a/crates/hir_def/src/item_tree/lower.rs +++ b/crates/hir_def/src/item_tree/lower.rs @@ -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) } diff --git a/crates/ide_assists/src/handlers/extract_type_alias.rs b/crates/ide_assists/src/handlers/extract_type_alias.rs index 4bccf59847..eac8857c67 100644 --- a/crates/ide_assists/src/handlers/extract_type_alias.rs +++ b/crates/ide_assists/src/handlers/extract_type_alias.rs @@ -31,7 +31,7 @@ pub(crate) fn extract_type_alias(acc: &mut Assists, ctx: &AssistContext) -> Opti let item = ctx.find_node_at_offset::()?; let insert = match_ast! { match (item.syntax().parent()?) { - ast::AssocItemList(it) => it.syntax().parent()?.clone(), + ast::AssocItemList(it) => it.syntax().parent()?, _ => item.syntax().clone(), } }; diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs index 6f685c02f3..cb4f08e535 100644 --- a/crates/ide_completion/src/context.rs +++ b/crates/ide_completion/src/context.rs @@ -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() diff --git a/crates/proc_macro_api/src/msg.rs b/crates/proc_macro_api/src/msg.rs index f525df1525..14eed42890 100644 --- a/crates/proc_macro_api/src/msg.rs +++ b/crates/proc_macro_api/src/msg.rs @@ -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; } diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 4567446036..49ee4b9224 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -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;