From 1755b57e1a568176bc0bda144889460e7d603cd5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 8 May 2021 23:09:36 +0300 Subject: internal: pull_assignment_up uses mutable trees --- crates/syntax/src/ast/make.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/syntax/src') diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index f8b508a90..5a6687397 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -275,6 +275,9 @@ pub fn expr_tuple(elements: impl IntoIterator) -> ast::Expr { let expr = elements.into_iter().format(", "); expr_from_text(&format!("({})", expr)) } +pub fn expr_assignment(lhs: ast::Expr, rhs: ast::Expr) -> ast::Expr { + expr_from_text(&format!("{} = {}", lhs, rhs)) +} fn expr_from_text(text: &str) -> ast::Expr { ast_from_text(&format!("const C: () = {};", text)) } -- cgit v1.2.3