Guest User

Untitled

a guest
Dec 11th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. struct Point {
  2. x: i32,
  3. y: i32
  4. }
  5.  
  6. impl Point {
  7. fn new(x: i32, y: i32) -> Point {
  8. Point { x: x, y: y }
  9. }
  10. }
  11.  
  12. fn main() {
  13. let point = Point::new(3, 5);
  14. let Point { x: _, y: y } = point;
  15.  
  16. println!("y == {}", y);
  17. }
Add Comment
Please, Sign In to add comment