Skip to content

Commit

Permalink
Example Point changes coordinates.
Browse files Browse the repository at this point in the history
When the implementation a point moves from tuple to struct, the point coordinates should remain the same to avoid confusion.
  • Loading branch information
clemensw committed Dec 29, 2015
1 parent aad634e commit 799b503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct Point {
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:
Expand Down Expand Up @@ -176,7 +176,7 @@ struct Point {
y: f64,
}
let p1 = Point { x: 0.0, y: 0.0 };
let p1 = Point { x: 0.0, y: 5.0 };
let x = p1.x;
```

Expand Down

0 comments on commit 799b503

Please sign in to comment.