derive try_into_packet automatically

This commit is contained in:
Vinzenz Schroeter 2025-06-22 12:27:42 +02:00
parent 8116375fd0
commit 5ecb84ed16
9 changed files with 102 additions and 100 deletions

View file

@ -36,7 +36,10 @@ impl ByteSlice {
unsafe { std::slice::from_raw_parts(self.start, self.length) }
}
#[allow(clippy::mut_from_ref, reason = "This is used to get a pointer from the C side")]
#[allow(
clippy::mut_from_ref,
reason = "This is used to get a pointer from the C side."
)]
pub(crate) unsafe fn as_slice_mut(&self) -> &mut [u8] {
unsafe { std::slice::from_raw_parts_mut(self.start, self.length) }
}