1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

//! 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(),
		}
	}
}