.clone() over .to_owned()

This commit is contained in:
Jeroen Vannevel 2022-01-05 21:10:03 +00:00
parent 2724b35490
commit 8c0b848694
No known key found for this signature in database
GPG Key ID: 78EF5F52F38C49BD

View File

@ -161,7 +161,7 @@ fn valid_target_expr(node: SyntaxNode) -> Option<ast::Expr> {
}
fn get_receiver_type(ctx: &AssistContext, expression: &ast::Expr) -> Option<hir::Type> {
let receiver = get_receiver(expression.to_owned())?;
let receiver = get_receiver(expression.clone())?;
Some(ctx.sema.type_of_expr(&receiver)?.original())
}