Skip to content

Commit a5ac115

Browse files
committed
impl Debug (3) MultiProduct
This requires that debug_fmt_fields can also cope with tuple elements.
1 parent b055dc9 commit a5ac115

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/adaptors/multi_product.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ pub struct MultiProduct<I>(Vec<MultiProductIter<I>>)
1818
where I: Iterator + Clone,
1919
I::Item: Clone;
2020

21+
impl<I> std::fmt::Debug for MultiProduct<I>
22+
where
23+
I: Iterator + Clone + std::fmt::Debug,
24+
I::Item: Clone + std::fmt::Debug,
25+
{
26+
debug_fmt_fields!(CoalesceBy, 0);
27+
}
28+
2129
/// Create a new cartesian product iterator over an arbitrary number
2230
/// of iterators of the same type.
2331
///

src/impl_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! Implementation's internal macros
33
44
macro_rules! debug_fmt_fields {
5-
($tyname:ident, $($($field:ident).+),*) => {
5+
($tyname:ident, $($($field:tt/*TODO ideally we would accept ident or tuple element here*/).+),*) => {
66
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
77
f.debug_struct(stringify!($tyname))
88
$(

0 commit comments

Comments
 (0)