rustils::parse::short
pub fn bool_to_i16(a: bool) -> i16
Parse bool to i16
bool
i16
If a is false then returns 0. If a is true then returns 1.
a
false
true
use rustils::parse::short::bool_to_i16; assert_eq!(bool_to_i16(true), 1_i16); assert_eq!(bool_to_i16(false), 0_i16);