usc/mystruct/
mod.rs

1
2
3#[macro_export]
4macro_rules! mystruct_init {
5    ($($t:ty),*) => {
6        $(
7            impl std::fmt::Display for $t {
8                fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9                    write!(f, "{}", serde_json::to_string(self).unwrap())
10                }
11            }
12        )*
13    }
14}
15