Remove neesless clone

This commit is contained in:
k-nasa 2021-10-10 10:50:51 +09:00
parent 820393f72d
commit b50cb5c261
8 changed files with 10 additions and 10 deletions

View file

@ -169,7 +169,7 @@ fn extraction_target(node: &SyntaxNode, selection_range: TextRange) -> Option<Fu
let expr = ast::Expr::cast(node.clone())?;
// A node got selected fully
if node.text_range() == selection_range {
return FunctionBody::from_expr(expr.clone());
return FunctionBody::from_expr(expr);
}
node.ancestors().find_map(ast::Expr::cast).and_then(FunctionBody::from_expr)