We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84fae7e commit 581aa8dCopy full SHA for 581aa8d
core/src/fmt/num.rs
@@ -88,7 +88,9 @@ unsafe trait GenericRadix: Sized {
88
};
89
}
90
91
- let buf = &buf[curr..];
+ // SAFETY: `curr` is initialized to `buf.len()` and is only decremented,
92
+ // so it is always in bounds.
93
+ let buf = unsafe { buf.get_unchecked(curr..) };
94
// SAFETY: The only chars in `buf` are created by `Self::digit` which are assumed to be
95
// valid UTF-8
96
let buf = unsafe {
0 commit comments