diff options
Diffstat (limited to 'doc/tutorial.md')
| -rw-r--r-- | doc/tutorial.md | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index b58ba6c3222..b7a07f4021a 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -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), |
