Skip to content

Commit 6f1cdbd

Browse files
committed
---
yaml --- r: 32283 b: refs/heads/dist-snap c: ee37f8a h: refs/heads/master i: 32281: 163cf45 32279: 1e16aa4 v: v3
1 parent fb5323e commit 6f1cdbd

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
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 6e7d5e1cbddeee95a1a7c996b99d78dec0da2954
10+
refs/heads/dist-snap: ee37f8a0065f5e050b65aadabbb66fcae5085db4
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/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)