mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 10:58:02 +00:00
Migrate pull_assignment_up assist to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
9a1fc3cdb8
commit
c6ce2abd47
4 changed files with 57 additions and 25 deletions
|
|
@ -680,7 +680,7 @@ pub fn expr_tuple(elements: impl IntoIterator<Item = ast::Expr>) -> ast::TupleEx
|
|||
let expr = elements.into_iter().format(", ");
|
||||
expr_from_text(&format!("({expr})"))
|
||||
}
|
||||
pub fn expr_assignment(lhs: ast::Expr, rhs: ast::Expr) -> ast::Expr {
|
||||
pub fn expr_assignment(lhs: ast::Expr, rhs: ast::Expr) -> ast::BinExpr {
|
||||
expr_from_text(&format!("{lhs} = {rhs}"))
|
||||
}
|
||||
fn expr_from_text<E: Into<ast::Expr> + AstNode>(text: &str) -> E {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue