]> git.lizzy.rs Git - rust.git/commitdiff
doc: add missing decls to example, r=burningtree.
authorGraydon Hoare <graydon@mozilla.com>
Tue, 11 Dec 2012 21:43:14 +0000 (13:43 -0800)
committerGraydon Hoare <graydon@mozilla.com>
Tue, 11 Dec 2012 21:43:14 +0000 (13:43 -0800)
doc/tutorial.md

index b58ba6c3222ed994fb0098f4c19188e13cc48ba2..b7a07f4021a5aa7f28848e6120d72fb22aae99cd 100644 (file)
@@ -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),