From d7f3d858add197f91969c69b1d4a14dbcb801f03 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sun, 19 Apr 2020 15:15:49 -0400 Subject: Some clippy fixes --- crates/ra_assists/src/handlers/add_from_impl_for_enum.rs | 2 +- crates/ra_assists/src/handlers/introduce_variable.rs | 2 +- crates/ra_assists/src/handlers/merge_imports.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists/src/handlers') diff --git a/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs index 864373aa5..0621487e8 100644 --- a/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs +++ b/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs @@ -98,7 +98,7 @@ fn already_has_from_impl( }; let var_ty = hir_enum_var.fields(sema.db)[0].signature_ty(sema.db); - e_ty.impls_trait(sema.db, from_trait, &[var_ty.clone()]) + e_ty.impls_trait(sema.db, from_trait, &[var_ty]) } #[cfg(test)] diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs index 8d0f7e922..8c09e6bcd 100644 --- a/crates/ra_assists/src/handlers/introduce_variable.rs +++ b/crates/ra_assists/src/handlers/introduce_variable.rs @@ -124,7 +124,7 @@ fn anchor_stmt(expr: ast::Expr) -> Option<(SyntaxNode, bool)> { } } - if ast::Stmt::cast(node.clone().into()).is_some() { + if ast::Stmt::cast(node.clone()).is_some() { return Some((node, false)); } diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index ef0ce0586..4be1238f1 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs @@ -30,7 +30,7 @@ pub(crate) fn merge_imports(ctx: AssistCtx) -> Option { .filter_map(|dir| neighbor(&use_item, dir)) .filter_map(|it| Some((it.clone(), it.use_tree()?))) .find_map(|(use_item, use_tree)| { - Some((try_merge_trees(&tree, &use_tree)?, use_item.clone())) + Some((try_merge_trees(&tree, &use_tree)?, use_item)) })?; rewriter.replace_ast(&tree, &merged); -- cgit v1.2.3