Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Point {
- x: i32,
- y: i32
- }
- impl Point {
- fn new(x: i32, y: i32) -> Point {
- Point { x: x, y: y }
- }
- }
- fn main() {
- let point = Point::new(3, 5);
- let Point { x: _, y: y } = point;
- println!("y == {}", y);
- }
Add Comment
Please, Sign In to add comment