fix: make::expr_closure() -> ClosureExpr

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
Prajwal S N 2025-04-11 02:42:19 +05:30
parent 92a7890814
commit 728d72fbe1
No known key found for this signature in database
GPG key ID: 60701A603988FAC2
3 changed files with 6 additions and 7 deletions

View file

@ -652,7 +652,10 @@ pub fn expr_ref(expr: ast::Expr, exclusive: bool) -> ast::Expr {
pub fn expr_reborrow(expr: ast::Expr) -> ast::Expr {
expr_from_text(&format!("&mut *{expr}"))
}
pub fn expr_closure(pats: impl IntoIterator<Item = ast::Param>, expr: ast::Expr) -> ast::Expr {
pub fn expr_closure(
pats: impl IntoIterator<Item = ast::Param>,
expr: ast::Expr,
) -> ast::ClosureExpr {
let params = pats.into_iter().join(", ");
expr_from_text(&format!("|{params}| {expr}"))
}