[][src]Function rustils::parse::byte::bool_to_i8

pub fn bool_to_i8(a: bool) -> i8

Parse bool to i8

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

Arguments

Examples

use rustils::parse::byte::bool_to_i8;

assert_eq!(bool_to_i8(true), 1_i8);
assert_eq!(bool_to_i8(false), 0_i8);