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

pub fn i8_to_bool(a: i8) -> bool

Parse i8 to bool

If a is 0 then returns false, otherwise true.

Arguments

  • a - Any i8 number

Examples

use rustils::parse::boolean::i8_to_bool;

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

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