rename sub_ptr 😅
This commit is contained in:
parent
1805b33483
commit
c813d8f3e4
18 changed files with 51 additions and 51 deletions
|
@ -280,13 +280,13 @@ impl<'a> MemDecoder<'a> {
|
|||
#[inline]
|
||||
pub fn len(&self) -> usize {
|
||||
// SAFETY: This recovers the length of the original slice, only using members we never modify.
|
||||
unsafe { self.end.sub_ptr(self.start) }
|
||||
unsafe { self.end.offset_from_unsigned(self.start) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn remaining(&self) -> usize {
|
||||
// SAFETY: This type guarantees current <= end.
|
||||
unsafe { self.end.sub_ptr(self.current) }
|
||||
unsafe { self.end.offset_from_unsigned(self.current) }
|
||||
}
|
||||
|
||||
#[cold]
|
||||
|
@ -400,7 +400,7 @@ impl<'a> Decoder for MemDecoder<'a> {
|
|||
#[inline]
|
||||
fn position(&self) -> usize {
|
||||
// SAFETY: This type guarantees start <= current
|
||||
unsafe { self.current.sub_ptr(self.start) }
|
||||
unsafe { self.current.offset_from_unsigned(self.start) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue