doc: Fix some broken tutorial examples. rs=bustage

This commit is contained in:
Patrick Walton 2012-12-29 21:52:51 -08:00
parent 10333a5f3d
commit 4b3dd4b920
1 changed files with 2 additions and 0 deletions

View File

@ -738,6 +738,7 @@ can have its fields extracted with dot notation and not just destructuring.
For example: For example:
~~~~ ~~~~
# use core::float;
# struct Point {x: float, y: float} # struct Point {x: float, y: float}
# fn square(x: float) -> float { x * x } # fn square(x: float) -> float { x * x }
enum Shape { enum Shape {
@ -2280,6 +2281,7 @@ struct level. Note that fields and methods are _public_ by default.
~~~ ~~~
mod farm { mod farm {
# use farm;
# pub fn make_me_a_farm() -> farm::Farm { farm::Farm { chickens: ~[], cows: ~[], farmer: Human(0) } } # pub fn make_me_a_farm() -> farm::Farm { farm::Farm { chickens: ~[], cows: ~[], farmer: Human(0) } }
pub struct Farm { pub struct Farm {
priv mut chickens: ~[Chicken], priv mut chickens: ~[Chicken],