diff options
Diffstat (limited to 'vendor/itertools/src/impl_macros.rs')
-rw-r--r-- | vendor/itertools/src/impl_macros.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/itertools/src/impl_macros.rs b/vendor/itertools/src/impl_macros.rs new file mode 100644 index 000000000..5772baeb6 --- /dev/null +++ b/vendor/itertools/src/impl_macros.rs @@ -0,0 +1,28 @@ +//! +//! Implementation's internal macros + +macro_rules! debug_fmt_fields { + ($tyname:ident, $($($field:tt/*TODO ideally we would accept ident or tuple element here*/).+),*) => { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(stringify!($tyname)) + $( + .field(stringify!($($field).+), &self.$($field).+) + )* + .finish() + } + } +} + +macro_rules! clone_fields { + ($($field:ident),*) => { + fn clone(&self) -> Self { + Self { + $($field: self.$field.clone(),)* + } + } + } +} + +macro_rules! ignore_ident{ + ($id:ident, $($t:tt)*) => {$($t)*}; +} |