September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,10 @@
fn some_other_function(p: Option<Point>) {
match p {
Some(Point { x: 0, y: 0 }) => println!("Point is on origin"),
Some(Point { x: 0, y: _ }) | Some(Point { x: _, y: 0 }) => println!("Point is on an axis"),
Some(Point {x: a, y: b}) if a == b println!("x and y are the same value"),
Some(Point {x: ref mut a, y: ref b}) if x > 4 && y < 2 => println!("we got a mutable reference to x-value and an immutable reference to y-value."),
op @ Some(p) => println!("op is the Option<Point> while p is the contained Point"),
None => println!("We didn't get a point"),
}
}