doc: add missing decls to example, r=burningtree.
This commit is contained in:
parent
fb498ff59f
commit
645bd98b60
1 changed files with 2 additions and 0 deletions
|
|
@ -1838,6 +1838,8 @@ combination of arguments of the appropriate types. The usual way is to write
|
|||
a function that returns `Option<T>` instead of `T`.
|
||||
|
||||
~~~~
|
||||
# struct Point {x: float, y: float}
|
||||
# enum Shape { Circle(Point, float), Rectangle(Point, Point) }
|
||||
fn radius(shape: Shape) -> Option<float> {
|
||||
match shape {
|
||||
Circle(_, radius) => Some(radius),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue