Skip to content

Commit 6511568

Browse files
committed
---
yaml --- r: 28199 b: refs/heads/try c: ee37f8a h: refs/heads/master i: 28197: 96d2827 28195: 511c87d 28191: b238f58 v: v3
1 parent 6c66ef2 commit 6511568

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 6e7d5e1cbddeee95a1a7c996b99d78dec0da2954
5+
refs/heads/try: ee37f8a0065f5e050b65aadabbb66fcae5085db4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/doc/tutorial.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,12 @@ To create a new record based on the value of an existing record
10191019
you construct it using the `with` keyword:
10201020

10211021
~~~~
1022+
# impl {x:float, y:float} : core::cmp::Eq {
1023+
# pure fn eq(&&other: {x:float, y:float}) -> bool {
1024+
# self.x == other.x && self.y == other.y
1025+
# }
1026+
# }
1027+
10221028
let oldpoint = {x: 10f, y: 20f};
10231029
let newpoint = {x: 0f with oldpoint};
10241030
assert newpoint == {x: 0f, y: 20f};
@@ -1437,7 +1443,10 @@ also done with square brackets (zero-based):
14371443
# fn draw_scene(c: crayon) { }
14381444
14391445
let crayons = ~[banana_mania, beaver, bittersweet];
1440-
if crayons[0] == bittersweet { draw_scene(crayons[0]); }
1446+
match crayons[0] {
1447+
bittersweet => draw_scene(crayons[0]),
1448+
_ => ()
1449+
}
14411450
~~~~
14421451

14431452
By default, vectors are immutable—you can not replace their elements.

0 commit comments

Comments
 (0)