Corelib
pub trait BoolTrait>
Some(t)
bool
true
None
fn then_some, T, +Drop>(self: bool, t: T) -> Option
assert!(false.then_some(0) == None); assert!(true.then_some(0) == Some(0));
Was this page helpful?