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

pub fn i32_to_bool(a: i32) -> bool

Parse i32 to bool

If a is 0 then returns false, otherwise true.

Arguments

  • a - Any i32 number

Examples

use rustils::parse::boolean::i32_to_bool;

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

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