Skip to content

Commit 062c264

Browse files
authored
Merge pull request #128 from ryanavella/master
Adding missing size_hint for UnicodeSentences, UnicodeWords, and UnicodeWordIndices
2 parents e718ec3 + 6375d1e commit 062c264

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy