diff --git a/library/core/src/char/decode.rs b/library/core/src/char/decode.rs index 4784418f98c50..89e741a0c3e9c 100644 --- a/library/core/src/char/decode.rs +++ b/library/core/src/char/decode.rs @@ -122,7 +122,7 @@ impl> Iterator for DecodeUtf16 { let (low, high) = self.iter.size_hint(); // we could be entirely valid surrogates (2 elements per // char), or entirely non-surrogates (1 element per char) - (low / 2, high) + (low.div_ceil(2), high) } }