Skip to content

Commit

Permalink
Merge pull request #128 from ryanavella/master
Browse files Browse the repository at this point in the history
Adding missing size_hint for UnicodeSentences, UnicodeWords, and UnicodeWordIndices
  • Loading branch information
Manishearth authored Dec 24, 2023
2 parents e718ec3 + 6375d1e commit 062c264
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sentence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ impl<'a> Iterator for UnicodeSentences<'a> {
fn next(&mut self) -> Option<&'a str> {
self.inner.next()
}

#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}

impl<'a> Iterator for USentenceBounds<'a> {
Expand Down
10 changes: 10 additions & 0 deletions src/word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ impl<'a> Iterator for UnicodeWords<'a> {
fn next(&mut self) -> Option<&'a str> {
self.inner.next()
}

#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}
impl<'a> DoubleEndedIterator for UnicodeWords<'a> {
#[inline]
Expand Down Expand Up @@ -68,6 +73,11 @@ impl<'a> Iterator for UnicodeWordIndices<'a> {
fn next(&mut self) -> Option<(usize, &'a str)> {
self.inner.next()
}

#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}
impl<'a> DoubleEndedIterator for UnicodeWordIndices<'a> {
#[inline]
Expand Down

0 comments on commit 062c264

Please sign in to comment.