rustils::parse::ulong
pub fn bool_to_u64_res(a: bool) -> ParseResultU64
Parse bool to u64
bool
u64
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::ulong::bool_to_u64_res; assert_eq!(bool_to_u64_res(true), Ok(1_u64)); assert_eq!(bool_to_u64_res(false), Ok(0_u64));