[][src]Function rustils::parse::ubyte::bool_to_u8

pub fn bool_to_u8(a: bool) -> u8

Parse bool to u8

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

Arguments

Examples

use rustils::parse::ubyte::bool_to_u8;

assert_eq!(bool_to_u8(true), 1_u8);
assert_eq!(bool_to_u8(false), 0_u8);