diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-06-23 12:26:15 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-06-23 12:26:15 +0200 |
| commit | 8ff5c4394cdfc11f29de36123a6c9618e12c9904 (patch) | |
| tree | 08da69f839f5c24c845a9b54fa2b2d63c9a7cb4d /src/libstd/sys | |
| parent | 4960f2f9074d0d0f9de80b39f0b0ded6547e2ad8 (diff) | |
| download | rust-8ff5c4394cdfc11f29de36123a6c9618e12c9904.tar.gz rust-8ff5c4394cdfc11f29de36123a6c9618e12c9904.zip | |
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`.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<usize>) { - let (len, _) = self.bytes.size_hint(); + let len = self.bytes.len(); (len.saturating_add(3) / 4, Some(len)) } } |
