| 1 | use formatx::formatx; |
| 2 | use std::fmt::Display; |
| 3 | |
| 4 | #[derive(Debug)] |
| 5 | struct Foo { |
| 6 | _bar: String, |
| 7 | } |
| 8 | |
| 9 | impl Display for Foo { |
| 10 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 11 | write!(f, "{:?}", self) |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | fn main() { |
| 16 | let foo = Foo { |
| 17 | _bar: "foo-bar-struct".to_owned(), |
| 18 | }; |
| 19 | |
| 20 | println!("{}", formatx!("{:#?}", foo).unwrap()); |
| 21 | } |