rustils::parse::uint
pub fn bool_to_u32(a: bool) -> u32
Parse bool to u32
bool
u32
If a is false then returns 0. If a is true then returns 1.
a
false
true
use rustils::parse::uint::bool_to_u32; assert_eq!(bool_to_u32(true), 1_u32); assert_eq!(bool_to_u32(false), 0_u32);