Skip to content

Commit

Permalink
Adding missing size_hint implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanavella committed Dec 24, 2023
1 parent e718ec3 commit 6375d1e
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
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
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 6375d1e

Please sign in to comment.