diff options
| author | Giga Bowser <45986823+Giga-Bowser@users.noreply.github.com> | 2024-12-16 14:27:31 -0500 |
|---|---|---|
| committer | Giga Bowser <45986823+Giga-Bowser@users.noreply.github.com> | 2025-01-06 15:32:08 -0600 |
| commit | ef7bb04deca035a5ac06bfbfa55a78f073ab9833 (patch) | |
| tree | a6ae28d23d531795100f60f2299b68cccbb16c62 /src/tools/rust-analyzer/crates/syntax | |
| parent | aacc2ebfc842559de4fd09e6c1e00b9322e73cb4 (diff) | |
| download | rust-ef7bb04deca035a5ac06bfbfa55a78f073ab9833.tar.gz rust-ef7bb04deca035a5ac06bfbfa55a78f073ab9833.zip | |
internal: `make::expr_tuple` should return `ast::TupleExpr`
Diffstat (limited to 'src/tools/rust-analyzer/crates/syntax')
| -rw-r--r-- | src/tools/rust-analyzer/crates/syntax/src/ast/make.rs | 2 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/syntax/src/syntax_editor.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs index dc966a81fe4..812b0dc888a 100644 --- a/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs +++ b/src/tools/rust-analyzer/crates/syntax/src/ast/make.rs @@ -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})")) } diff --git a/src/tools/rust-analyzer/crates/syntax/src/syntax_editor.rs b/src/tools/rust-analyzer/crates/syntax/src/syntax_editor.rs index 992a847663a..81c52e26cf1 100644 --- a/src/tools/rust-analyzer/crates/syntax/src/syntax_editor.rs +++ b/src/tools/rust-analyzer/crates/syntax/src/syntax_editor.rs @@ -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(); |
