Initial import of itertools-0.9.0.
Bug: 155309706
Change-Id: Id790c146e836f0eadfb0d8a103cbe2d226a598c3
diff --git a/src/impl_macros.rs b/src/impl_macros.rs
new file mode 100644
index 0000000..04ab8e1
--- /dev/null
+++ b/src/impl_macros.rs
@@ -0,0 +1,24 @@
+//!
+//! Implementation's internal macros
+
+macro_rules! debug_fmt_fields {
+ ($tyname:ident, $($($field:ident).+),*) => {
+ 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(),)*
+ }
+ }
+ }
+}