wl_tools/words.rs
1/// An iterator over words `W`
2pub struct Words<'a, W: 'a>(Box<dyn Iterator<Item = &'a W> + 'a>);
3
4impl<'a, W> Words<'a, W> {
5 pub fn new(inner_boxed: Box<dyn Iterator<Item = &'a W> + 'a>) -> Self {
6 Self(inner_boxed)
7 }
8}
9
10impl<'a, W> Iterator for Words<'a, W> {
11 type Item = &'a W;
12
13 fn next(&mut self) -> Option<Self::Item> {
14 self.0.next()
15 }
16}