(b: [u8; 16])
| 11 | |
| 12 | impl CFList { |
| 13 | pub fn from_bytes(b: [u8; 16]) -> Result<Self> { |
| 14 | let mut bb: [u8; 15] = [0; 15]; |
| 15 | bb.clone_from_slice(&b[..15]); |
| 16 | |
| 17 | // match on CFListType. |
| 18 | match b[15] { |
| 19 | 0x00 => Ok(CFList::Channels(CFListChannels::from_bytes(bb))), |
| 20 | 0x01 => Ok(CFList::ChannelMask(CFListChannelMasks::from_bytes(bb))), |
| 21 | _ => Err(anyhow!("unexpected CFListType")), |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | pub fn to_bytes(&self) -> Result<[u8; 16]> { |
| 26 | let mut b: [u8; 16] = [0; 16]; |
nothing calls this directly
no test coverage detected