[][src]Function rustils::parse::short::bool_to_i16_res

pub fn bool_to_i16_res(a: bool) -> ParseResultI16

Parse bool to i16

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

Arguments

Examples

use rustils::parse::short::bool_to_i16_res;

assert_eq!(bool_to_i16_res(true), Ok(1_i16));
assert_eq!(bool_to_i16_res(false), Ok(0_i16));