common
This commit is contained in:
parent
6a3c097741
commit
7a03b079d8
@ -1,3 +1,4 @@
|
||||
mod common;
|
||||
pub mod aabb;
|
||||
pub mod model;
|
||||
pub mod integer;
|
||||
|
22
src/newtypes/common.rs
Normal file
22
src/newtypes/common.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#[binrw::binrw]
|
||||
#[brw(little,repr=u8)]
|
||||
pub enum Boolio{
|
||||
True,
|
||||
False
|
||||
}
|
||||
impl Into<bool> for Boolio{
|
||||
fn into(self)->bool{
|
||||
match self{
|
||||
Boolio::True=>true,
|
||||
Boolio::False=>false,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl From<bool> for Boolio{
|
||||
fn from(value:bool)->Self{
|
||||
match value{
|
||||
true=>Boolio::True,
|
||||
false=>Boolio::False,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user