Skip to content

Commit d4c66b3

Browse files
authored
Merge pull request #1853 from archer-321/fix/1845-wildcard-in-pattern-destructuring
Align pattern destructuring with rest of patterns documentation
2 parents ce4d0e0 + 7d891f2 commit d4c66b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ Patterns can be used to *destructure* [structs], [enums], and [tuples].
9292
Destructuring breaks up a value into its component pieces.
9393
The syntax used is almost the same as when creating such values.
9494

95-
r[patterns.destructure.placeholder]
96-
In a pattern whose [scrutinee] expression has a `struct`, `enum` or `tuple` type, a placeholder (`_`) stands in for a *single* data field, whereas a wildcard `..` stands in for *all* the remaining fields of a particular variant.
95+
r[patterns.destructure.wildcard]
96+
In a pattern whose [scrutinee] expression has a `struct`, `enum` or `tuple` type, a [wildcard pattern](#wildcard-pattern) (`_`) stands in for a *single* data field, whereas an [et cetera](#grammar-StructPatternEtCetera) or [rest pattern](#rest-patterns) (`..`) stands in for *all* the remaining fields of a particular variant.
9797

9898
r[patterns.destructure.named-field-shorthand]
9999
When destructuring a data structure with named (but not numbered) fields, it is allowed to write `fieldname` as a shorthand for `fieldname: fieldname`.

0 commit comments

Comments
 (0)