internal: make::expr_if should return ast::IfExpr

This commit is contained in:
Giga Bowser 2024-12-14 14:31:57 -05:00
parent 913d197a04
commit c549be9ab6
7 changed files with 8 additions and 7 deletions

View file

@ -607,7 +607,7 @@ pub fn expr_if(
condition: ast::Expr,
then_branch: ast::BlockExpr,
else_branch: Option<ast::ElseBranch>,
) -> ast::Expr {
) -> ast::IfExpr {
let else_branch = match else_branch {
Some(ast::ElseBranch::Block(block)) => format!("else {block}"),
Some(ast::ElseBranch::IfExpr(if_expr)) => format!("else {if_expr}"),