rustils::parse::byte
pub fn bool_to_i8_res(a: bool) -> ParseResultI8
Parse bool to i8
bool
i8
If a is false then returns Ok(0). If a is true then returns Ok(1).
a
false
Ok(0)
true
Ok(1)
use rustils::parse::byte::bool_to_i8_res; assert_eq!(bool_to_i8_res(true), Ok(1_i8)); assert_eq!(bool_to_i8_res(false), Ok(0_i8));