You need to use &mut self instead of &self and make the p variable mutable: struct Point { x: i32, y: i32, } impl Point { fn up(&mut self) ...
確定! 回上一頁