mirror of https://github.com/rust-lang/rust.git
doc: Fix some broken tutorial examples. rs=bustage
This commit is contained in:
parent
10333a5f3d
commit
4b3dd4b920
|
@ -738,6 +738,7 @@ can have its fields extracted with dot notation and not just destructuring.
|
|||
For example:
|
||||
|
||||
~~~~
|
||||
# use core::float;
|
||||
# struct Point {x: float, y: float}
|
||||
# fn square(x: float) -> float { x * x }
|
||||
enum Shape {
|
||||
|
@ -2280,6 +2281,7 @@ struct level. Note that fields and methods are _public_ by default.
|
|||
|
||||
~~~
|
||||
mod farm {
|
||||
# use farm;
|
||||
# pub fn make_me_a_farm() -> farm::Farm { farm::Farm { chickens: ~[], cows: ~[], farmer: Human(0) } }
|
||||
pub struct Farm {
|
||||
priv mut chickens: ~[Chicken],
|
||||
|
|
Loading…
Reference in New Issue