Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 12224be

Browse files
committedOct 13, 2015
Unhide some code from the Traits section
Having this code section hidden is misleading because it makes it look like implementing Circle for Foo automatically makes Foo implement Shape.
1 parent ec4362d commit 12224be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/doc/reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,11 +1435,11 @@ struct Foo;
14351435

14361436
trait Shape { fn area(&self) -> f64; }
14371437
trait Circle : Shape { fn radius(&self) -> f64; }
1438-
# impl Shape for Foo {
1439-
# fn area(&self) -> f64 {
1440-
# 0.0
1441-
# }
1442-
# }
1438+
impl Shape for Foo {
1439+
fn area(&self) -> f64 {
1440+
0.0
1441+
}
1442+
}
14431443
impl Circle for Foo {
14441444
fn radius(&self) -> f64 {
14451445
println!("calling area: {}", self.area());

0 commit comments

Comments
 (0)
Please sign in to comment.