fix the endianess

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2023-08-31 16:57:05 +02:00
parent 68b11dc036
commit a4e5679c7b
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
4 changed files with 98 additions and 108 deletions

View file

@ -81,15 +81,15 @@ use syn::{
/// Example::Zero
/// );
/// assert_eq!(
/// Example::deserialize_from_slice(&[1u8, 0x01u8, 0x23u8, 0x45, 0x67]).unwrap(),
/// Example::deserialize_from_slice(&[1u8, 0x67, 0x45, 0x23u8, 0x01u8]).unwrap(),
/// Example::One(0x01234567)
/// );
/// assert_eq!(
/// Example::deserialize_from_slice(&[2u8, 0xFEu8, 0xDCu8, 0x01u8, 0x23u8, 0x45, 0x67]).unwrap(),
/// Example::deserialize_from_slice(&[2u8, 0xDCu8, 0xFEu8, 0x67, 0x45, 0x23u8, 0x01u8]).unwrap(),
/// Example::Two { a: 0xFEDC, b: 0x01234567 }
/// );
/// assert_eq!(
/// Example::deserialize_from_slice(&[42u8, 0x01u8, 0x23u8, 0x45, 0x67]).unwrap(),
/// Example::deserialize_from_slice(&[42u8, 0x67, 0x45, 0x23u8, 0x01u8]).unwrap(),
/// Example::Dft(42, 0x01234567)
/// );
/// ```
@ -110,7 +110,7 @@ use syn::{
/// }
///
/// assert_eq!(
/// Example::deserialize_from_slice(&[0x42, 0, 1, 2, 3, 0x66, 0x66]).unwrap(),
/// Example::deserialize_from_slice(&[0x42, 3, 2, 1, 0, 0x66, 0x66]).unwrap(),
/// Example { a: 0x00010203 }
/// );
/// ```