We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42422dc commit cf69365Copy full SHA for cf69365
src/iter.rs
@@ -45,7 +45,7 @@ impl<'a> Bytes<'a> {
45
pub fn peek_ahead(&self, n: usize) -> Option<u8> {
46
// SAFETY: obtain a potentially OOB pointer that is later compared against the `self.end`
47
// pointer.
48
- let ptr = unsafe { self.cursor.add(n) };
+ let ptr = self.cursor.wrapping_add(n);
49
if ptr < self.end {
50
// SAFETY: bounds checked pointer dereference is safe
51
Some(unsafe { *ptr })
0 commit comments