Function taking a mutable borrow of a Point field
(p_y: &mut i32)
| 6 | |
| 7 | #[derive(Copy, Clone)] |
| 8 | struct RepeatPoint { |
| 9 | x: i32, |
| 10 | y: i32, |
| 11 | } |
| 12 | |
| 13 | // Function taking a mutable borrow of a Point field |
| 14 | fn make_y_negative(p_y: &mut i32) { |
| 15 | if *p_y > 0 { |
| 16 | *p_y = -(*p_y); |