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

pub fn bool_to_i16(a: bool) -> i16

Parse bool to i16

If a is false then returns 0.
If a is true then returns 1.

Arguments

Examples

use rustils::parse::short::bool_to_i16;

assert_eq!(bool_to_i16(true), 1_i16);
assert_eq!(bool_to_i16(false), 0_i16);