Merge pull request #605 from matthiasbeyer/libimagentryfilter/bool-filter
Add BoolFilter
This commit is contained in:
commit
6e988782da
2 changed files with 25 additions and 0 deletions
22
libimagentryfilter/src/builtin/bool_filter.rs
Normal file
22
libimagentryfilter/src/builtin/bool_filter.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
use libimagstore::store::Entry;
|
||||
|
||||
use filter::Filter;
|
||||
|
||||
pub struct BoolFilter(bool);
|
||||
|
||||
impl BoolFilter {
|
||||
|
||||
pub fn new(b: bool) -> BoolFilter {
|
||||
BoolFilter(b)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Filter for BoolFilter {
|
||||
|
||||
fn filter(&self, _: &Entry) -> bool {
|
||||
self.0
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,2 +1,5 @@
|
|||
pub mod content;
|
||||
pub mod header;
|
||||
|
||||
pub mod bool_filter;
|
||||
|
||||
|
|
Loading…
Reference in a new issue