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

pub fn u8_to_bool(a: u8) -> bool

Parse u8 to bool

If a is 0 then returns false, otherwise true.

Arguments

  • a - Any u8 number

Examples

use rustils::parse::boolean::u8_to_bool;

let a = 42_u8;
let b = 1_u8;
let c = 0_u8;

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