From 8ff5c4394cdfc11f29de36123a6c9618e12c9904 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Thu, 23 Jun 2016 12:26:15 +0200 Subject: Use `len` instead of `size_hint` where appropiate This makes it clearer that we're not just looking for a lower bound but rather know that the iterator is an `ExactSizeIterator`. --- src/libstd/sys/common/wtf8.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index d705b8986d0..b6be85a4dfa 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -715,7 +715,7 @@ impl<'a> Iterator for Wtf8CodePoints<'a> { #[inline] fn size_hint(&self) -> (usize, Option) { - let (len, _) = self.bytes.size_hint(); + let len = self.bytes.len(); (len.saturating_add(3) / 4, Some(len)) } } -- cgit 1.4.1-3-g733a5