Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #[derive(Debug)]
  2. struct Point {
  3. pub x: i32,
  4. pub y: i32,
  5. }
  6.  
  7. fn main() {
  8. let primary = Point { x: -10, y: 8, };
  9. let mut reference = &primary;
  10. println!("point is: {:?}", reference);
  11. {
  12. let secondary = Point { x: 5, y: 5, };
  13. reference = &secondary;
  14. }
  15. println!("point is: {:?}", reference);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement