#[derive(Debug)]
struct Point<T> {
x: T,
y: T,
}
fn main() {
let integer = Point { x: 45, y: 98 };
println!("integer = {:?}", integer);
println!("integer.x = {:?}", integer.x);
println!("integer,y = {:?}", integer.y);
let float = Point { x: 3.14, y: 6.21 };
println!("float = {:?}", float);
println!("float.x = {:?}", float.x);
println!("float,y = {:?}", float.y);
}
/*
run:
integer = Point { x: 45, y: 98 }
integer.x = 45
integer,y = 98
float = Point { x: 3.14, y: 6.21 }
float.x = 3.14
float,y = 6.21
*/