From 4a0f916e3388a4efa92e11805d5cb35332befcab Mon Sep 17 00:00:00 2001 From: Zeromemer <68763656+Zeromemer@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:30:59 +0200 Subject: [PATCH] fix stale comments left over from ed3711e --- library/core/src/str/iter.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/library/core/src/str/iter.rs b/library/core/src/str/iter.rs index d2985d8a1866..283aa9a6a73a 100644 --- a/library/core/src/str/iter.rs +++ b/library/core/src/str/iter.rs @@ -99,9 +99,6 @@ fn advance_by(&mut self, mut remainder: usize) -> Result<(), NonZero> { #[inline] fn size_hint(&self) -> (usize, Option) { let len = self.iter.len(); - // `(len + 3)` can't overflow, because we know that the `slice::Iter` - // belongs to a slice in memory which has a maximum length of - // `isize::MAX` (that's well below `usize::MAX`). (len.div_ceil(4), Some(len)) } @@ -1528,9 +1525,6 @@ fn size_hint(&self) -> (usize, Option) { // is therefore determined by assuming the remaining bytes contain as // many 3-byte sequences as possible. The highest bytes:code units // ratio is for 1-byte sequences, so use this for the upper bound. - // `(len + 2)` can't overflow, because we know that the `slice::Iter` - // belongs to a slice in memory which has a maximum length of - // `isize::MAX` (that's well below `usize::MAX`) if self.extra == 0 { (len.div_ceil(3), Some(len)) } else {