diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-24 11:48:32 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-24 11:48:32 +0000 |
commit | 6ef64622afd818d7b091e36b8228bc8ebd52d2e1 (patch) | |
tree | cc93bacfd4b51fb2c60e4da01f5df34e87fc7eaf /crates/ra_syntax | |
parent | 8617fe641ddc0d8c4303c5bbe49152ea320ef179 (diff) | |
parent | ff62ef19f7c29b033d49962bfebf4d4cf43694d5 (diff) |
Merge #3700
3700: fill match arms with empty block rather than unit tuple r=matklad a=JoshMcguigan
As requested by @Veetaha in #3689 and #3687, this modifies the fill match arms assist to create match arms as an empty block `{}` rather than a unit tuple `()`.
In one test I left one of the pre-existing match arms as a unit tuple, and added a body to another match arm, to demonstrate that the contents of existing match arms persist.
Co-authored-by: Josh Mcguigan <[email protected]>
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/make.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 9257ccd1a..1145b69e8 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -87,6 +87,9 @@ pub fn block_from_expr(e: ast::Expr) -> ast::Block { | |||
87 | pub fn expr_unit() -> ast::Expr { | 87 | pub fn expr_unit() -> ast::Expr { |
88 | expr_from_text("()") | 88 | expr_from_text("()") |
89 | } | 89 | } |
90 | pub fn expr_empty_block() -> ast::Expr { | ||
91 | expr_from_text("{}") | ||
92 | } | ||
90 | pub fn expr_unimplemented() -> ast::Expr { | 93 | pub fn expr_unimplemented() -> ast::Expr { |
91 | expr_from_text("unimplemented!()") | 94 | expr_from_text("unimplemented!()") |
92 | } | 95 | } |