rustils::parse::int
pub fn bool_to_i32(a: bool) -> i32
Parse bool to i32
bool
i32
If a is false then returns 0. If a is true then returns 1.
a
false
true
use rustils::parse::int::bool_to_i32; assert_eq!(bool_to_i32(true), 1_i32); assert_eq!(bool_to_i32(false), 0_i32);