mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
internal: make::expr_tuple should return ast::TupleExpr
This commit is contained in:
parent
c549be9ab6
commit
f388482119
6 changed files with 9 additions and 8 deletions
|
|
@ -656,7 +656,7 @@ pub fn expr_field(receiver: ast::Expr, field: &str) -> ast::Expr {
|
|||
pub fn expr_paren(expr: ast::Expr) -> ast::Expr {
|
||||
expr_from_text(&format!("({expr})"))
|
||||
}
|
||||
pub fn expr_tuple(elements: impl IntoIterator<Item = ast::Expr>) -> ast::Expr {
|
||||
pub fn expr_tuple(elements: impl IntoIterator<Item = ast::Expr>) -> ast::TupleExpr {
|
||||
let expr = elements.into_iter().format(", ");
|
||||
expr_from_text(&format!("({expr})"))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -344,7 +344,8 @@ mod tests {
|
|||
make::expr_literal("2").into(),
|
||||
),
|
||||
make::expr_literal("true").into(),
|
||||
]),
|
||||
])
|
||||
.into(),
|
||||
);
|
||||
|
||||
let to_wrap = root.syntax().descendants().find_map(ast::TupleExpr::cast).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue