Skip to content

Commit 7125faa

Browse files
committed
---
yaml --- r: 30710 b: refs/heads/incoming c: 2d3396b h: refs/heads/master v: v3
1 parent 1109af9 commit 7125faa

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 0e14fd6e133a9eec6c3e5f8472ebf6788695781e
9+
refs/heads/incoming: 2d3396bef191e06568ecbb7c7dd55667db1d8809
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/tutorial.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,6 @@ struct Stack {
742742
With a value of such a type, you can do `mystack.head += 1`. If `mut` were
743743
omitted from the type, such an assignment would result in a type error.
744744

745-
## Struct patterns
746-
747745
Structs can be destructured in `match` patterns. The basic syntax is
748746
`Name {fieldname: pattern, ...}`:
749747
~~~~
@@ -845,8 +843,6 @@ let my_gizmo_id = GizmoId(10);
845843
let id_int: int = *my_gizmo_id;
846844
~~~~
847845

848-
## Enum patterns
849-
850846
For enum types with multiple variants, destructuring is the only way to
851847
get at their contents. All variant constructors can be used as
852848
patterns, as in this definition of `area`:
@@ -862,7 +858,10 @@ fn area(sh: Shape) -> float {
862858
}
863859
~~~~
864860

865-
Another example, matching nullary enum variants:
861+
Like other patterns, a lone underscore ignores individual fields.
862+
Ignoring all fields of a variant can be written `Circle(*)`. As in
863+
their introductory form, nullary enum patterns are written without
864+
parentheses.
866865

867866
~~~~
868867
# type Point = {x: float, y: float};

0 commit comments

Comments
 (0)