Parse endianness See also: https://docs.python.org/3/library/struct.html?highlight=struct#byte-order-size-and-alignment
(chars: &mut Peekable<I>)
| 30 | /// Parse endianness |
| 31 | /// See also: https://docs.python.org/3/library/struct.html?highlight=struct#byte-order-size-and-alignment |
| 32 | fn parse<I>(chars: &mut Peekable<I>) -> Self |
| 33 | where |
| 34 | I: Sized + Iterator<Item = u8>, |
| 35 | { |
| 36 | let e = match chars.peek() { |
| 37 | Some(b'@') => Self::Native, |
| 38 | Some(b'=') => Self::Host, |
| 39 | Some(b'<') => Self::Little, |
| 40 | Some(b'>') | Some(b'!') => Self::Big, |
| 41 | _ => return Self::Native, |
| 42 | }; |
| 43 | chars.next().unwrap(); |
| 44 | e |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | trait ByteOrder { |
nothing calls this directly
no test coverage detected