diff --git a/src/lib.rs b/src/lib.rs index 7360758..d69a23e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,12 +8,26 @@ /// /// See [`IterAccumulate::accumulate()`] for more information. #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] +#[derive(Clone)] pub struct Accumulate { iter: I, acc: B, f: F, } +impl fmt::Debug for Accumulate +where + I: fmt::Debug, + B: fmt::Debug, +{ + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Accumulate") + .field("iter", &self.iter) + .field("acc", &self.acc) + .finish() + } +} + impl Accumulate { fn new(iter: I, acc: B, f: F) -> Accumulate { Accumulate { iter, acc, f }