Crate const_utils

Source
Expand description

Utility functions for doing simple things in a const function.

Modules§

i8
i16
i32
i64
i128
isize
u8
u16
u32
u64
u128
usize

Functions§

cond
Returns if_true if cond is true, and otherwise returns if_false
is_zero
Returns 1 if n is zero and 0 if n is greater than zero
max
Returns the maximum of a and b
min
Returns the minimum of a and b
not_zero
Returns 1 if n is zero and 0 if n is greater than zero
safe_div
Returns dividend - divisor if divisor isn’t zero, and core::usize::MAX otherwise.