Skip to content

Commit 3589780

Browse files
Philippe-Choletjswrenn
authored andcommitted
PadUsing::rfold
1 parent e3f8b27 commit 3589780

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pad_tail.rs

+10
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ where
9797
Some((self.filler)(self.min))
9898
}
9999
}
100+
101+
fn rfold<B, G>(self, mut init: B, mut f: G) -> B
102+
where
103+
G: FnMut(B, Self::Item) -> B,
104+
{
105+
init = (self.iter.len()..self.min)
106+
.map(self.filler)
107+
.rfold(init, &mut f);
108+
self.iter.rfold(init, f)
109+
}
100110
}
101111

102112
impl<I, F> ExactSizeIterator for PadUsing<I, F>

0 commit comments

Comments
 (0)