Guest User

Untitled

a guest
Jun 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. struct Foo {
  2. y: f32,
  3. }
  4.  
  5. impl Foo {
  6. fn get_y(&mut self) -> &mut f32 {
  7. &mut self.y
  8. }
  9. }
  10.  
  11. fn main() {
  12. let mut foo = Foo { y: 0.0 };
  13. println!("{}", foo.get_y());
  14. }
Add Comment
Please, Sign In to add comment