(input: &mut &[u8])
| 36 | } |
| 37 | |
| 38 | fn read(input: &mut &[u8]) -> Result<(Self, bool)> { |
| 39 | let v = consume_byte(input)?; |
| 40 | let p_u8 = crate::nightly::div_ceil_u8(v, 2); |
| 41 | let offset_by_min = v & 1 != 0; |
| 42 | let p = match p_u8 { |
| 43 | 0 => Self::_256, |
| 44 | 1 => Self::_16, |
| 45 | 2 => Self::_6, |
| 46 | 3 => Self::_4, |
| 47 | 4 => Self::_3, |
| 48 | 5 => Self::_2, |
| 49 | _ => return invalid_packing(), |
| 50 | }; |
| 51 | debug_assert_eq!(p as u8, p_u8); |
| 52 | Ok((p, offset_by_min)) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | pub(crate) fn invalid_packing<T>() -> Result<T> { |
nothing calls this directly
no test coverage detected