diff --git a/src/primitives/hrp.rs b/src/primitives/hrp.rs index 51d4d198d..50852eaa9 100644 --- a/src/primitives/hrp.rs +++ b/src/primitives/hrp.rs @@ -207,8 +207,7 @@ pub struct ByteIter<'b> { impl<'b> Iterator for ByteIter<'b> { type Item = u8; fn next(&mut self) -> Option { self.iter.next().copied() } - - fn size_hint(&self) -> (usize, Option) { (self.len(), Some(self.len())) } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } impl<'b> ExactSizeIterator for ByteIter<'b> { @@ -231,8 +230,7 @@ pub struct CharIter<'b> { impl<'b> Iterator for CharIter<'b> { type Item = char; fn next(&mut self) -> Option { self.iter.next().map(Into::into) } - - fn size_hint(&self) -> (usize, Option) { (self.len(), Some(self.len())) } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } impl<'b> ExactSizeIterator for CharIter<'b> { @@ -255,8 +253,7 @@ impl<'b> Iterator for LowercaseByteIter<'b> { fn next(&mut self) -> Option { self.iter.next().map(|b| if is_ascii_uppercase(b) { b | 32 } else { b }) } - - fn size_hint(&self) -> (usize, Option) { (self.len(), Some(self.len())) } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } impl<'b> ExactSizeIterator for LowercaseByteIter<'b> { @@ -279,8 +276,7 @@ pub struct LowercaseCharIter<'b> { impl<'b> Iterator for LowercaseCharIter<'b> { type Item = char; fn next(&mut self) -> Option { self.iter.next().map(Into::into) } - - fn size_hint(&self) -> (usize, Option) { (self.len(), Some(self.len())) } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } impl<'b> ExactSizeIterator for LowercaseCharIter<'b> {