kaspa-utils 0.15.0

Kaspa utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub trait OptionExtensions<T> {
    /// Substitute for unstable [`Option<T>::is_none_or`]
    fn is_none_or_ex(&self, f: impl FnOnce(&T) -> bool) -> bool;
}

impl<T> OptionExtensions<T> for Option<T> {
    fn is_none_or_ex(&self, f: impl FnOnce(&T) -> bool) -> bool {
        match self {
            Some(v) => f(v),
            None => true,
        }
    }
}