From 3d9b3a8575ef3cb557fd847b941000df3b2db670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 21 Mar 2021 12:05:08 +0100 Subject: remove more redundant clones (clippy::redundant_clone()) --- crates/syntax/src/algo.rs | 4 ++-- crates/syntax/src/ast/make.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/syntax') diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 82ebf9037..a153a9e1c 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs @@ -567,7 +567,7 @@ impl<'a> SyntaxRewriter<'a> { fn element_to_green(element: SyntaxElement) -> NodeOrToken { match element { - NodeOrToken::Node(it) => NodeOrToken::Node(it.green().to_owned()), + NodeOrToken::Node(it) => NodeOrToken::Node(it.green()), NodeOrToken::Token(it) => NodeOrToken::Token(it.green().to_owned()), } } @@ -625,7 +625,7 @@ fn position_of_child(parent: &SyntaxNode, child: SyntaxElement) -> usize { fn to_green_element(element: SyntaxElement) -> NodeOrToken { match element { - NodeOrToken::Node(it) => it.green().to_owned().into(), + NodeOrToken::Node(it) => it.green().into(), NodeOrToken::Token(it) => it.green().to_owned().into(), } } diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 810c8d4c8..7049affd9 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -532,7 +532,7 @@ fn ast_from_text(text: &str) -> N { } fn unroot(n: SyntaxNode) -> SyntaxNode { - SyntaxNode::new_root(n.green().to_owned()) + SyntaxNode::new_root(n.green()) } pub mod tokens { -- cgit v1.2.3