mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-25 17:28:17 +00:00
feat: for loop to while let assist
This commit is contained in:
parent
185f9deb45
commit
53f3e6fd5f
5 changed files with 467 additions and 2 deletions
|
|
@ -623,6 +623,10 @@ pub fn expr_for_loop(pat: ast::Pat, expr: ast::Expr, block: ast::BlockExpr) -> a
|
|||
expr_from_text(&format!("for {pat} in {expr} {block}"))
|
||||
}
|
||||
|
||||
pub fn expr_while_loop(condition: ast::Expr, block: ast::BlockExpr) -> ast::WhileExpr {
|
||||
expr_from_text(&format!("while {condition} {block}"))
|
||||
}
|
||||
|
||||
pub fn expr_loop(block: ast::BlockExpr) -> ast::Expr {
|
||||
expr_from_text(&format!("loop {block}"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue