I have some small structs/enums that I'm storing in vectors. I like being able to pretty-print values with the {:#?}
format specifier, but I'd like to be able to print the vector on multiple lines, while each element takes just a single line.
That is, I'd like this code:
#[derive(Debug)]
struct Point { x: f64, y: f64 }
let points: Vec<Point> = unimplemented!();
println!("{:#?}", points);
to produce this:
[
Point { x: 1.0, y: 1.0 },
Point { x: 2.0, y: 4.0 }
]
Is there a way to derive Debug
but suppress the alternate form when printing?