mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 11:54:25 +00:00
internal: pull_assignment_up uses mutable trees
This commit is contained in:
parent
e603090961
commit
1755b57e1a
2 changed files with 72 additions and 70 deletions
|
@ -275,6 +275,9 @@ pub fn expr_tuple(elements: impl IntoIterator<Item = ast::Expr>) -> 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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue