//! Implements DirectMatch for the BooleanCriterium, doesn't export any functions
use crate::boolean::BooleanCriterium;
use crate::DirectMatch;
impl DirectMatch<bool> for BooleanCriterium {
fn criterium_match(&self, data: &bool) -> bool {
match self {
Self::Equals(other) => data == other,
Self::IsNone => false,
}
}
}
impl DirectMatch<Option<bool>> for BooleanCriterium {
fn criterium_match(&self, data: &Option<bool>) -> bool {
match self {
Self::Equals(other) => data.as_ref() == Some(other),
Self::IsNone => data.is_none(),
}
}
}