Skip to content

Commit

Permalink
Merge #224
Browse files Browse the repository at this point in the history
224: Convert between int and bytes #189 r=cuviper a=kaidokert

Picking up #103 from `@flier` to rebase and factor in feedback. Making a quick draft first

Co-authored-by: Kaido Kert <kaidokert@gmail.com>
Co-authored-by: Josh Stone <cuviper@gmail.com>
Co-authored-by: kaidokert <kaidokert@gmail.com>
  • Loading branch information
3 people committed Jul 20, 2023
2 parents 13cd223 + bbeeaa2 commit 4195ddf
Show file tree
Hide file tree
Showing 4 changed files with 408 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ fn main() {
}
ac.emit_expression_cfg("1f64.is_subnormal()", "has_is_subnormal");

ac.emit_expression_cfg("1u32.to_ne_bytes()", "has_int_to_from_bytes");
ac.emit_expression_cfg("3.14f64.to_ne_bytes()", "has_float_to_from_bytes");

autocfg::rerun_path("build.rs");
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub use crate::float::FloatConst;
pub use crate::cast::{cast, AsPrimitive, FromPrimitive, NumCast, ToPrimitive};
pub use crate::identities::{one, zero, One, Zero};
pub use crate::int::PrimInt;
pub use crate::ops::bytes::{FromBytes, ToBytes};
pub use crate::ops::checked::{
CheckedAdd, CheckedDiv, CheckedMul, CheckedNeg, CheckedRem, CheckedShl, CheckedShr, CheckedSub,
};
Expand Down

0 comments on commit 4195ddf

Please sign in to comment.