icu_segmenter/iterator_helpers.rs
1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5//! Macros and utilities to help implement the various iterator types.
6
7macro_rules! derive_usize_iterator_with_type {
8 ($ty:tt) => {
9 impl<'l, 's, Y: RuleBreakType<'l, 's> + ?Sized> Iterator for $ty<'l, 's, Y> {
10 type Item = usize;
11 #[inline]
12 fn next(&mut self) -> Option<Self::Item> {
13 self.0.next()
14 }
15 }
16 };
17}
18
19pub(crate) use derive_usize_iterator_with_type;