Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
I think the std::net socket automatically handles the le -> be conversion so doing it manually causes issues.
  • Loading branch information
quackitsquinn committed May 16, 2024
1 parent e51706b commit 2296edb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lazuli_core/src/sendable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ macro_rules! impl_sendable_number {
impl Sendable for $t {
fn send(&self) -> Vec<u8> {
// Follow the standard of big-endian
<$t>::to_be_bytes(*self).to_vec()
<$t>::to_ne_bytes(*self).to_vec()
}

fn recv(data: &mut dyn Read,) -> Result<Self> {
let mut buffer = [0; std::mem::size_of::<$t>()];
data.read_exact(&mut buffer)?;
Ok(<$t>::from_be_bytes(buffer))
Ok(<$t>::from_ne_bytes(buffer))
}
}
};
Expand Down

0 comments on commit 2296edb

Please sign in to comment.