Skip to content

Commit c875ddd

Browse files
committed
feat: add orderfloat
1 parent 659d359 commit c875ddd

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

components/micromarshal/src/marshal.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ impl Marshal for OrderedFloat<f64> {
104104
}
105105
}
106106

107-
impl Marshal for f64 {
108-
fn marshal(&self, scratch: &mut [u8]) {
109-
let bits = self.to_bits();
110-
let bytes = bits.to_le_bytes();
111-
scratch.copy_from_slice(&bytes);
112-
}
113-
}
114-
115107
impl Marshal for bool {
116108
fn marshal(&self, scratch: &mut [u8]) {
117109
scratch[0] = *self as u8;

components/micromarshal/src/unmarshal.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ use std::io;
1717
use std::io::Error;
1818
use std::io::Result;
1919

20+
use ordered_float::OrderedFloat;
21+
2022
pub trait Unmarshal<T> {
2123
fn unmarshal(scratch: &[u8]) -> T;
2224
fn try_unmarshal(scratch: &[u8]) -> Result<T> {

0 commit comments

Comments
 (0)