-
-
Notifications
You must be signed in to change notification settings - Fork 782
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a better name for patterns with a single unlabelled field
Instead of being called `value_0` it just uses `value` which looks way better when there's just a single unlabelled field: let Wibble(value) = arg // instead of let Wibble(value_0) = arg
- Loading branch information
1 parent
5116c2b
commit 3196ea3
Showing
3 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...er__tests__action__pattern_match_on_argument_single_unlabelled_field_is_not_numbered.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/action.rs | ||
expression: "\npub type Wibble {\n Wibble(Int)\n}\n\npub fn main(arg: Wibble) {}\n" | ||
--- | ||
----- BEFORE ACTION | ||
|
||
pub type Wibble { | ||
Wibble(Int) | ||
} | ||
|
||
pub fn main(arg: Wibble) {} | ||
↑ | ||
|
||
|
||
----- AFTER ACTION | ||
|
||
pub type Wibble { | ||
Wibble(Int) | ||
} | ||
|
||
pub fn main(arg: Wibble) { | ||
let Wibble(value) = arg | ||
} |