Guest User

Untitled

a guest
Sep 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. struct Vector {
  2. x: f32,
  3. y: f32
  4. }
  5.  
  6. fn scale_vec(v: Vector, scale: f32) -> Vector {
  7. let mut v = v;
  8. for x in [&mut v.x, &mut v.y].iter() {
  9. **x = (**x)*scale;
  10. }
  11. v
  12. }
Add Comment
Please, Sign In to add comment