Guest User

Untitled

a guest
Dec 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #[derive(Debug)]
  2. struct Foo {
  3. x: u32,
  4. y: usize,
  5. }
  6.  
  7. fn main() {
  8. let mut bar = Foo { x: 5, y: 1000032 };
  9. bar.x = 8;
  10. let mut baz = &mut bar;
  11. //bar.x = 10;
  12. {
  13. let x = &mut baz;
  14. x.x = 9;
  15. baz.x = 7;
  16. }
  17. bar.x = 10;
  18.  
  19. println!("Hello, world! {:?}", bar);
  20. }
Add Comment
Please, Sign In to add comment