Skip to content

Commit 2ecd420

Browse files
kaidokertflier
authored andcommitted
Convert between int and bytes
Co-authored-by: Flier Lu <flier.lu@gmail.com>
1 parent 13cd223 commit 2ecd420

File tree

4 files changed

+389
-0
lines changed

4 files changed

+389
-0
lines changed

build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ fn main() {
1717
}
1818
ac.emit_expression_cfg("1f64.is_subnormal()", "has_is_subnormal");
1919

20+
ac.emit_expression_cfg("1u32.to_ne_bytes()", "has_int_to_from_bytes");
21+
ac.emit_expression_cfg("3.14f64.to_ne_bytes()", "has_float_to_from_bytes");
22+
2023
autocfg::rerun_path("build.rs");
2124
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub use crate::float::FloatConst;
3535
pub use crate::cast::{cast, AsPrimitive, FromPrimitive, NumCast, ToPrimitive};
3636
pub use crate::identities::{one, zero, One, Zero};
3737
pub use crate::int::PrimInt;
38+
pub use crate::ops::bytes::ToFromBytes;
3839
pub use crate::ops::checked::{
3940
CheckedAdd, CheckedDiv, CheckedMul, CheckedNeg, CheckedRem, CheckedShl, CheckedShr, CheckedSub,
4041
};

0 commit comments

Comments
 (0)