use point::Point; fn main() { // Default is used to obtain a Point to (0, 0) let p: Point = Point::default(); // ^ // Type is assigned here println!("p = {}", p); // (0, 0) let _p: Point = Point::::default(); // ^ // Type can be assigned here too // Giving just 1 number will assign both x and y let p1: Point = Point::from(3); println!("p1 = {}", p1); // (3, 3) // Giving a tuple of 2 numbers will assign x and y respectively let p2: Point = Point::from((9_i64, 81)); // ^ ^ // x y // x also adds the type hint that 9 is an i64 (Which defines the Point to i64) // y MUST be i64 also, no mix matching types println!("p2 = {}", p2); }