Skip to content

Commit bfd9eae

Browse files
committed
refactor: remove unused read_unchecked
1 parent 9c9c6b6 commit bfd9eae

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

libdd-trace-utils/src/change_buffer/buffer.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,6 @@ impl ChangeBuffer {
6161
Ok(T::from_bytes(bytes))
6262
}
6363

64-
/// Read a value without bounds checking.
65-
///
66-
/// # Safety
67-
///
68-
/// Caller must ensure `*index + size_of::<T>() <= self.len` and that `index + size_of<T>::() <
69-
/// usize::MAX`.
70-
#[inline(always)]
71-
unsafe fn read_unchecked<T: FromBytes>(&self, index: &mut usize) -> T {
72-
// Safety: the allocation of `self.ptr` is guaranteed to be valid for read and writes at
73-
// construction time. We do not materialize other references during the lifetime of `slice`.
74-
let slice = unsafe { self.as_slice() };
75-
let bytes = slice.get_unchecked(*index..*index + T::FROM_BYTES_SIZE);
76-
*index += T::FROM_BYTES_SIZE;
77-
T::from_bytes(bytes)
78-
}
79-
8064
/// Write a raw `u32` in the buffer.
8165
pub fn write_u32(&mut self, offset: usize, value: u32) -> Result<()> {
8266
let len = self.len;

0 commit comments

Comments
 (0)