Example Point changes coordinates.

When the implementation a point moves from tuple to struct, the point coordinates should remain the same to avoid confusion.
This commit is contained in:
Clemens Wehrmann 2015-12-29 09:52:22 +01:00
parent aad634e61d
commit 799b5034cc

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 };
``` ```
Heres what declaring a `struct` looks like: Heres 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;
``` ```