Commit 76cd60a
committed
Revise extending tuple struct constructor examples
The example for the tuple enum variant constructor should go above the
example that already uses a tuple enum variant constructor in a nested
manner. This also matches the order in the list of extending
expressions above -- the list items for tuple struct constructors and
tuple enum variant constructors come after tuple expressions and
before block expressions.
For demonstrating a tuple enum variant constructor, it's better to use
`Some(_)` than to define one; `Option<T>` is well known enough.
For the tuple struct that we need to define, let's use a short name
like `W<T>` here rather than `TupleStruct<T>` (and show its
definition). When I see a name like `TupleStruct`, it takes me a
moment to confirm it's just a name and not more than that. We use
this `W<T>(T)` "wrapper" tuple struct definition elsewhere in the
Reference.
As a wording matter, we say "argument to" rather than "argument of".
Similarly, something isn't an argument to a tuple struct but an
argument to the tuple struct constructor, so let's say that.1 parent 5acc59f commit 76cd60a
1 file changed
+4
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
| 528 | + | |
528 | 529 | | |
529 | | - | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 532 | + | |
536 | 533 | | |
537 | 534 | | |
538 | 535 | | |
| |||
0 commit comments