pub trait BoolLike {
// Required method
fn as_bool(&self) -> bool;
}Expand description
A trait for types that can be interpreted as a bool.
Primitive numerical types (integers and floats) implement this trait, so you don’t have to implement this by yourself. However, you could implement it for your own custom type, if you want.
We don’t use num crate because it is overkill for our purposes.