/// Decodes u16 from 2 bytes in iter
Decodes u16 from 2 bytes in iter
Decodes u16 from 2 bytes in iter
pub(crate) fn decode_u16(bytes: &mut impl Iterator<Item = u8>) -> Result<u16> {
    let first = bytes.next().ok_or(Error::MessageEnded)?;
    let second = bytes.next().ok_or(Error::MessageEnded)?;
    Ok(u16::from_be_bytes([first, second]))
}
pub ( crate ) fn decode_u16 ( bytes : & mut impl Iterator < Item = u8 > ) -> Result < u16 > { let first = bytes . next ( ) . ok_or ( Error :: MessageEnded ) ? ; let second = bytes . next ( ) . ok_or ( Error :: MessageEnded ) ? ; Ok ( u16 :: from_be_bytes ( [ first , second ] ) ) }
Decodes u16 from 2 bytes in iter
Decodes u16 from 2 bytes in iter
bytes
&mut impl Iterator<Item = u8>