diff options
| author | bors <bors@rust-lang.org> | 2016-06-24 09:03:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-24 09:03:54 -0700 |
| commit | 4b89debc7b776a947331dd0ceaa52ba8476157b2 (patch) | |
| tree | d05eb419e87868c9f3478567922d918c05f9e01d /src/libstd/sys | |
| parent | 7189ae36116491ea4936ad34461c8d89f704608b (diff) | |
| parent | 8ff5c4394cdfc11f29de36123a6c9618e12c9904 (diff) | |
| download | rust-4b89debc7b776a947331dd0ceaa52ba8476157b2.tar.gz rust-4b89debc7b776a947331dd0ceaa52ba8476157b2.zip | |
Auto merge of #34425 - tbu-:pr_len_instead_of_size_hint, r=alexcrichton
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)) } } |
