diff --git a/src/pad_tail.rs b/src/pad_tail.rs index 4be781242..5595b42ba 100644 --- a/src/pad_tail.rs +++ b/src/pad_tail.rs @@ -97,6 +97,16 @@ where Some((self.filler)(self.min)) } } + + fn rfold(self, mut init: B, mut f: G) -> B + where + G: FnMut(B, Self::Item) -> B, + { + init = (self.iter.len()..self.min) + .map(self.filler) + .rfold(init, &mut f); + self.iter.rfold(init, f) + } } impl ExactSizeIterator for PadUsing