(buf: &mut Block<N>, _pos: &mut Self::Pos, val: usize)
| 48 | |
| 49 | #[allow(clippy::cast_possible_truncation)] |
| 50 | fn set_pos<N: ArraySize>(buf: &mut Block<N>, _pos: &mut Self::Pos, val: usize) { |
| 51 | debug_assert!(u8::try_from(val).is_ok()); |
| 52 | // SAFETY: we write to the last byte of `buf` which is always safe |
| 53 | unsafe { |
| 54 | let buf_ptr = buf.as_mut_ptr().cast::<u8>(); |
| 55 | let last_byte_ptr = buf_ptr.add(N::USIZE - 1); |
| 56 | ptr::write(last_byte_ptr, val as u8); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | #[inline(always)] |
| 61 | fn invariant(pos: usize, block_size: usize) -> bool { |
nothing calls this directly
no outgoing calls
no test coverage detected