struct Point { x: f64, y: f64 } impl Point { //fn display_struct(self: &Point) fn display_struct(&self) { println!("s.x: {}; s.y: {}", self.x, self.y) } } fn main() { let s = Point {x: 5.0, y: 5.0}; s.display_struct() }