Skip to content

Commit 5d5359c

Browse files
chore: fix incorrect comment
The comment describing the functionality of `EncodeUtf16::size_hint` has a double claim for highest bytes-to-code-units-ratio. This commit replaces one of the repeated occurrences to be about the _lowest_ ratio.
1 parent eabf390 commit 5d5359c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/str/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ impl<'a> Iterator for EncodeUtf16<'a> {
15231523
#[inline]
15241524
fn size_hint(&self) -> (usize, Option<usize>) {
15251525
let len = self.chars.iter.len();
1526-
// The highest bytes:code units ratio occurs for 3-byte sequences,
1526+
// The lowest bytes:code units ratio occurs for 3-byte sequences,
15271527
// since a 4-byte sequence results in 2 code units. The lower bound
15281528
// is therefore determined by assuming the remaining bytes contain as
15291529
// many 3-byte sequences as possible. The highest bytes:code units

0 commit comments

Comments
 (0)