diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-12 19:32:14 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-13 20:07:10 -0700 |
| commit | 8fa66e8e07ca565119de195ceefb20cff50ae1ea (patch) | |
| tree | f9ae9910b40b04ae62daff56b8de1ae002765d2e /doc/tutorial.md | |
| parent | a410652bc953137c8d579f218c2e3e68a9ef8c1c (diff) | |
librustc: Remove implicit self from the language, except for old-style drop blocks.
Diffstat (limited to 'doc/tutorial.md')
| -rw-r--r-- | doc/tutorial.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index 3fa53abf6b9..3e7b9400e17 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1135,7 +1135,7 @@ can sometimes make code awkward and parenthesis-filled. ~~~ # struct Point { x: float, y: float } # enum Shape { Rectangle(Point, Point) } -# impl Shape { fn area() -> int { 0 } } +# impl Shape { fn area(&self) -> int { 0 } } let start = @Point { x: 10f, y: 20f }; let end = ~Point { x: (*start).x + 100f, y: (*start).y + 100f }; let rect = &Rectangle(*start, *end); @@ -1149,7 +1149,7 @@ dot), so in most cases, explicitly dereferencing the receiver is not necessary. ~~~ # struct Point { x: float, y: float } # enum Shape { Rectangle(Point, Point) } -# impl Shape { fn area() -> int { 0 } } +# impl Shape { fn area(&self) -> int { 0 } } let start = @Point { x: 10f, y: 20f }; let end = ~Point { x: start.x + 100f, y: start.y + 100f }; let rect = &Rectangle(*start, *end); |
