Skip to content

Commit 01900d1

Browse files
committed
---
yaml --- r: 39533 b: refs/heads/incoming c: d098faa h: refs/heads/master i: 39531: 606a4df v: v3
1 parent f7c8b32 commit 01900d1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 21c9d0858b1ee0c6fe508a9eb1d229713a2649e4
9+
refs/heads/incoming: d098faa8555d48a9bc1de34542fc6d1dd5a2ab9c
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/tutorial.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,15 +2127,15 @@ This usage of traits is similar to Java interfaces.
21272127

21282128
We can write a trait declaration that _inherits_ from other traits, called _supertraits_.
21292129
Types that implement a trait must also implement its supertraits.
2130-
2131-
For example, we can define a `Circle` trait that only types that also have the `Shape` trait can have:
2130+
For example,
2131+
we can define a `Circle` trait that inherits from `Shape`.
21322132

21332133
~~~~
21342134
trait Shape { fn area(&self) -> float; }
21352135
trait Circle : Shape { fn radius(&self) -> float; }
21362136
~~~~
21372137

2138-
Now, implementations of `Circle` methods can call `Shape` methods:
2138+
Now, we can implement `Circle` on a type only if we also implement `Shape`.
21392139

21402140
~~~~
21412141
# trait Shape { fn area(&self) -> float; }
@@ -2153,6 +2153,8 @@ impl CircleStruct: Shape {
21532153
}
21542154
~~~~
21552155

2156+
Notice that methods of `Circle` can call methods on `Shape`, as our
2157+
`radius` implementation calls the `area` method.
21562158
This is a silly way to compute the radius of a circle
21572159
(since we could just return the `circle` field), but you get the idea.
21582160

0 commit comments

Comments
 (0)