From 7a03b079d8071446a1b056b5a41da895edf4bbea Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 27 Jul 2024 12:42:08 -0700 Subject: [PATCH] common --- src/newtypes.rs | 1 + src/newtypes/common.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/newtypes/common.rs diff --git a/src/newtypes.rs b/src/newtypes.rs index 8b12c6b..19e2e59 100644 --- a/src/newtypes.rs +++ b/src/newtypes.rs @@ -1,3 +1,4 @@ +mod common; pub mod aabb; pub mod model; pub mod integer; diff --git a/src/newtypes/common.rs b/src/newtypes/common.rs new file mode 100644 index 0000000..88ffac7 --- /dev/null +++ b/src/newtypes/common.rs @@ -0,0 +1,22 @@ +#[binrw::binrw] +#[brw(little,repr=u8)] +pub enum Boolio{ + True, + False +} +impl Into for Boolio{ + fn into(self)->bool{ + match self{ + Boolio::True=>true, + Boolio::False=>false, + } + } +} +impl From for Boolio{ + fn from(value:bool)->Self{ + match value{ + true=>Boolio::True, + false=>Boolio::False, + } + } +}