8000 Adding missing size_hint implementations. · ryanavella/unicode-segmentation@6375d1e · GitHub
[go: up one dir, main page]

Skip to content

Commit 6375d1e

Browse files
committed
Adding missing size_hint implementations.
1 parent e718ec3 commit 6375d1e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/sentence.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ impl<'a> Iterator for UnicodeSentences<'a> {
366366
fn next(&mut self) -> Option<&'a str> {
367367
self.inner.next()
368368
}
369+
370+
#[inline]
371+
fn size_hint(&self) -> (usize, Option<usize>) {
372+
self.inner.size_hint()
373+
}
369374
}
370375

371376
impl<'a> Iterator for USentenceBounds<'a> {

src/word.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ impl<'a> Iterator for UnicodeWords<'a> {
3636
fn next(&mut self) -> Option<&'a str> {
3737
self.inner.next()
3838
}
39+
40+
#[inline]
41+
fn size_hint(&self) -> (usize, Option<usize>) {
42+
self.inner.size_hint()
43+
}
3944
}
4045
impl<'a> DoubleEndedIterator for UnicodeWords<'a> {
4146
#[inline]
@@ -68,6 +73,11 @@ impl<'a> Iterator for UnicodeWordIndices<'a> {
6873
fn next(&mut self) -> Option<(usize, &'a str)> {
6974
self.inner.next()
7075
}
76+
77+
#[inline]
78+
fn size_hint(&self) -> (usize, Option<usize>) {
79+
self.inner.size_hint()
80+
}
7181
}
7282
impl<'a> DoubleEndedIterator for UnicodeWordIndices<'a> {
7383
#[inline]

0 commit comments

Comments
 (0)
0