From 0ac42b07938207d87c40baece3506c67f5bdedea Mon Sep 17 00:00:00 2001 From: p6nj Date: Fri, 17 Jan 2025 19:21:19 -0500 Subject: [PATCH] switch to native endianness --- bingus/src/img/image.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bingus/src/img/image.rs b/bingus/src/img/image.rs index bf0ff66..aa0606c 100644 --- a/bingus/src/img/image.rs +++ b/bingus/src/img/image.rs @@ -16,7 +16,7 @@ where { fn into_bytes(self) -> crate::Bytes { self.iter() - .flat_map(|subpixel| subpixel.to_be_bytes().as_ref().to_vec()) + .flat_map(|subpixel| subpixel.to_ne_bytes().as_ref().to_vec()) .collect() } } @@ -42,9 +42,9 @@ where format.width, format.height, bytes - .chunks_exact(P::Subpixel::zero().to_be_bytes().as_ref().len()) + .chunks_exact(P::Subpixel::zero().to_ne_bytes().as_ref().len()) .map(|p| { - P::Subpixel::from_be_bytes( + P::Subpixel::from_ne_bytes( &match ::Bytes::try_from(p) { Ok(v) => v, Err(_) => unreachable!("you messed up chunk size!"),