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