#[derive(Debug, Clone)] struct Point(i32, i32); impl Point { fn move_to(&self, x: i32, y: i32) -> Point { Point(x, y) } } fn main() { let p = Point(1, 2); println!("{:?} x:{} y:{}", p, p.0, p.1); println!("{:?}", p.move_to(3, 2)); }