INNER CODE UNIT · Rust
is_some
fishfolk/bones · framework_crates/bones_asset/src/lib.rs:71
pub fn is_some(&self) -> bool {
matches!(self, Maybe::Set(_))
}
/// Returns `true` if the option is an `Unset` value.
#[inline]
pub fn is_none(&self) -> bool {
matches!(self, Maybe::Unset)
}
/// Returns `true` if the option is a `Set` value containing the given value.
#[inline]
pub fn contains<U>(&self, x: &U) -> bool
where
U: PartialEq<T>,
{
match self {
Maybe::Set(y) => x == y,