Skip to content

Commit 9fccbe0

Browse files
committed
---
yaml --- r: 34363 b: refs/heads/snap-stage3 c: 4be7310 h: refs/heads/master i: 34361: 8f22faf 34359: a76b843 v: v3
1 parent 3ca06ab commit 9fccbe0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4b3dd4b9204171d0777749eaf1053fa240be24ec
4+
refs/heads/snap-stage3: 4be7310be0a2f35a5a73825b0718aa643c740c8b
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -733,22 +733,22 @@ fn point_from_direction(dir: Direction) -> Point {
733733
}
734734
~~~~
735735

736-
A special kind of enum variant, called _struct-like enums_,
737-
can have its fields extracted with dot notation and not just destructuring.
738-
For example:
736+
Enum variants may also be structs. For example:
739737

740738
~~~~
741739
# use core::float;
742740
# struct Point {x: float, y: float}
743741
# fn square(x: float) -> float { x * x }
744742
enum Shape {
745743
Circle { center: Point, radius: float },
746-
Rectangle { left: Point, right: Point }
744+
Rectangle { top_left: Point, bottom_right: Point }
747745
}
748746
fn area(sh: Shape) -> float {
749747
match sh {
750-
Circle(c) => float::consts::pi * square(c.radius),
751-
Rectangle(r) => r.right.x - r.left.x * r.right.y - r.right.y
748+
Circle { radius: radius, _ } => float::consts::pi * square(radius),
749+
Rectangle { top_left: top_left, bottom_right: bottom_right } => {
750+
(bottom_right.x - top_left.x) * (bottom_right.y - top_left.y)
751+
}
752752
}
753753
}
754754
~~~~

0 commit comments

Comments
 (0)