[][src]Function rustils::parse::boolean::i16_to_bool

pub fn i16_to_bool(a: i16) -> bool

Parse i16 to bool

If a is 0 then returns false, otherwise true.

Arguments

  • a - Any i16 number

Examples

use rustils::parse::boolean::i16_to_bool;

let a = 42_i16;
let b = -1_i16;
let c = 0_i16;

assert!(i16_to_bool(a));
assert!(i16_to_bool(b));
assert!(!i16_to_bool(c));