Merge pull request #52 from clemensw/structs_compare_to_tuples

Example Point changes coordinates.
This commit is contained in:
Steve Klabnik
2015-12-29 10:58:54 -05:00
+2 -2
View File
@@ -143,7 +143,7 @@ struct Point {
y: f64, y: f64,
} }
let p1 = Point { x: 0.0, y: 0.0 }; let p1 = Point { x: 0.0, y: 5.0 };
``` ```
Here’s what declaring a `struct` looks like: Here’s what declaring a `struct` looks like:
@@ -176,7 +176,7 @@ struct Point {
y: f64, y: f64,
} }
let p1 = Point { x: 0.0, y: 0.0 }; let p1 = Point { x: 0.0, y: 5.0 };
let x = p1.x; let x = p1.x;
``` ```