[][src]Function rustils::parse::ushort::bool_to_u16_res

pub fn bool_to_u16_res(a: bool) -> ParseResultU16

Parse bool to u16

If a is false then returns Ok(0).
If a is true then returns Ok(1).

Arguments

Examples

use rustils::parse::ushort::bool_to_u16_res;

assert_eq!(bool_to_u16_res(true), Ok(1_u16));
assert_eq!(bool_to_u16_res(false), Ok(0_u16));