diff --git a/doc/tutorial.md b/doc/tutorial.md index b58ba6c3222e..b7a07f4021a5 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` instead of `T`. ~~~~ +# struct Point {x: float, y: float} +# enum Shape { Circle(Point, float), Rectangle(Point, Point) } fn radius(shape: Shape) -> Option { match shape { Circle(_, radius) => Some(radius),