[][src]Function rustils::parse::ushort::bool_to_u16

pub fn bool_to_u16(a: bool) -> u16

Parse bool to u16

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

Arguments

Examples

use rustils::parse::ushort::bool_to_u16;

assert_eq!(bool_to_u16(true), 1_u16);
assert_eq!(bool_to_u16(false), 0_u16);