diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs index 4a2d1c08752..04ea9c5d7f9 100644 --- a/crates/hir_def/src/resolver.rs +++ b/crates/hir_def/src/resolver.rs @@ -472,7 +472,7 @@ fn process_names(&self, db: &dyn DefDatabase, f: &mut dyn FnMut(Name, ScopeDef)) } Scope::ExprScope(scope) => { if let Some((label, name)) = scope.expr_scopes.label(scope.scope_id) { - f(name.clone(), ScopeDef::Label(label)) + f(name, ScopeDef::Label(label)) } scope.expr_scopes.entries(scope.scope_id).iter().for_each(|e| { f(e.name().clone(), ScopeDef::Local(e.pat())); diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index 2748e25cf3b..fc73e435bfb 100644 --- a/crates/hir_expand/src/db.rs +++ b/crates/hir_expand/src/db.rs @@ -173,7 +173,7 @@ fn macro_arg_text(db: &dyn AstDatabase, id: MacroCallId) -> Option { }; let loc = db.lookup_intern_macro(id); let arg = loc.kind.arg(db)?; - Some(arg.green().to_owned()) + Some(arg.green()) } fn macro_arg(db: &dyn AstDatabase, id: MacroCallId) -> Option> { diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index cbbb535e554..c914a3b8e04 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs @@ -946,8 +946,7 @@ pub(crate) fn trait_environment_query( let substs = Substitution::type_params(db, trait_id); let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_id), substitution: substs }; let pred = WhereClause::Implemented(trait_ref); - let program_clause: chalk_ir::ProgramClause = - pred.clone().to_chalk(db).cast(&Interner); + let program_clause: chalk_ir::ProgramClause = pred.to_chalk(db).cast(&Interner); clauses.push(program_clause.into_from_env_clause(&Interner)); } diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 82ebf9037c0..a153a9e1c38 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs @@ -567,7 +567,7 @@ fn rewrite_self( 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 810c8d4c86d..7049affd95f 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 {