(buf: &Block<N>, _pos: &Self::Pos)
| 37 | const NAME: &'static str = "BlockBuffer<Eager>"; |
| 38 | |
| 39 | fn get_pos<N: ArraySize>(buf: &Block<N>, _pos: &Self::Pos) -> usize { |
| 40 | // SAFETY: last byte in `buf` for eager hashes is always properly initialized |
| 41 | let pos = unsafe { |
| 42 | let buf_ptr = buf.as_ptr().cast::<u8>(); |
| 43 | let last_byte_ptr = buf_ptr.add(N::USIZE - 1); |
| 44 | ptr::read(last_byte_ptr) |
| 45 | }; |
| 46 | pos as usize |
| 47 | } |
| 48 | |
| 49 | #[allow(clippy::cast_possible_truncation)] |
| 50 | fn set_pos<N: ArraySize>(buf: &mut Block<N>, _pos: &mut Self::Pos, val: usize) { |
nothing calls this directly
no outgoing calls
no test coverage detected