SHARE
TWEET

Untitled

a guest Oct 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top