Skip to content
This repository was archived by the owner on Aug 15, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ where
self.writer.write_all(&[0xf9, 0x7e, 0x00])
} else if f32::from(f16::from_f32(value)) == value {
let mut buf = [0xf9, 0, 0];
(&mut buf[1..]).copy_from_slice(&f16::from_f32(value).to_bits().to_be_bytes());
(&mut buf[1..]).copy_from_slice(&f16::from_f32(value).to_be_bytes());
self.writer.write_all(&buf)
} else {
let mut buf = [0xfa, 0, 0, 0, 0];
(&mut buf[1..]).copy_from_slice(&value.to_bits().to_be_bytes());
(&mut buf[1..]).copy_from_slice(&value.to_be_bytes());
self.writer.write_all(&buf)
}
.map_err(|e| e.into())
Expand All @@ -337,7 +337,7 @@ where
self.serialize_f32(value as f32)
} else {
let mut buf = [0xfb, 0, 0, 0, 0, 0, 0, 0, 0];
(&mut buf[1..]).copy_from_slice(&value.to_bits().to_be_bytes());
(&mut buf[1..]).copy_from_slice(&value.to_be_bytes());
self.writer.write_all(&buf).map_err(|e| e.into())
}
}
Expand Down