Open
Description
The reference contains the following sentence as patterns.destructure.placeholder
:
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.
The same page defines the _
pattern as a wildcard pattern and ..
as a rest pattern. Is this difference intended?
The line was introduced by 0003310e.
If this is indeed an inconsistency, would the following be an acceptable patch?
- 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.
+ In a pattern whose [scrutinee] expression has a `struct`, `enum` or `tuple` type, a wildcard pattern (`_`) stands in for a *single* data field, whereas a rest pattern (`..`) stands in for *all* the remaining fields of a particular variant.
Metadata
Metadata
Assignees
Labels
No labels