Last active
August 29, 2015 14:27
-
-
Save paomian/d426d3538099885478bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Point { | |
x: int, | |
y: int, | |
} | |
fn transform(p: Point) -> Point { | |
Point { x: p.x + 1, y: p.y + 1} | |
} | |
fn main() { | |
let p0 = Point { x: 5, y: 10}; | |
let p1 = transform(p0); | |
println!("{:?}", p1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment