blob: 04ab8e177fc17503d23a04dc1e7d82a116373319 [file] [log] [blame]
Jakub Kotura425e552020-12-21 17:28:15 +01001//!
2//! Implementation's internal macros
3
4macro_rules! debug_fmt_fields {
5 ($tyname:ident, $($($field:ident).+),*) => {
6 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
7 f.debug_struct(stringify!($tyname))
8 $(
9 .field(stringify!($($field).+), &self.$($field).+)
10 )*
11 .finish()
12 }
13 }
14}
15
16macro_rules! clone_fields {
17 ($($field:ident),*) => {
18 fn clone(&self) -> Self {
19 Self {
20 $($field: self.$field.clone(),)*
21 }
22 }
23 }
24}