From 8c0b848694a5b69a8b33b79aa63a6c953f06ba21 Mon Sep 17 00:00:00 2001 From: Jeroen Vannevel Date: Wed, 5 Jan 2022 21:10:03 +0000 Subject: [PATCH] .clone() over .to_owned() --- crates/ide_assists/src/handlers/extract_variable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ide_assists/src/handlers/extract_variable.rs b/crates/ide_assists/src/handlers/extract_variable.rs index 19525fa254e..61a8750b0c4 100644 --- a/crates/ide_assists/src/handlers/extract_variable.rs +++ b/crates/ide_assists/src/handlers/extract_variable.rs @@ -161,7 +161,7 @@ fn valid_target_expr(node: SyntaxNode) -> Option { } fn get_receiver_type(ctx: &AssistContext, expression: &ast::Expr) -> Option { - let receiver = get_receiver(expression.to_owned())?; + let receiver = get_receiver(expression.clone())?; Some(ctx.sema.type_of_expr(&receiver)?.original()) }