rustips How to print your Structs the way you want it

How to print your Structs the way you want it

The Struct Let’s keep it simple here with a struct for a 2D Point in space: pub struct Point { x: i32, y: i32 }   1st (fail) try If you try to print an instance of your struct you will get a panicked compiler let p = Point{x: 10, y: 5}; println!(“{}”, p); error[E0277]: …

Read Article Read More