Skip to content

Commit 12224be

Browse files
committed
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

+5-5
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)