summaryrefslogtreecommitdiffstats
path: root/libimagentryfilter
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-02-02 17:54:02 +0100
committerMatthias Beyer <mail@beyermatthias.de>2016-02-03 16:39:05 +0100
commitd4cee5459fec9bf5f90bb2f140134fbf91feec79 (patch)
tree9e03637d6c8d61e4427cd463b97d89c39a981a32 /libimagentryfilter
parent41564a7d8e2d7c1606b0cb1a17f4d5c7f7d5124e (diff)
Implement 3-{and,or} variants
Diffstat (limited to 'libimagentryfilter')
-rw-r--r--libimagentryfilter/src/filter.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/libimagentryfilter/src/filter.rs b/libimagentryfilter/src/filter.rs
index 8fa605b5..dd8128e4 100644
--- a/libimagentryfilter/src/filter.rs
+++ b/libimagentryfilter/src/filter.rs
@@ -20,11 +20,23 @@ pub trait Filter {
Or::new(Box::new(self), other)
}
+ fn or3(self, other: Box<Filter>, other2: Box<Filter>) -> Or
+ where Self: Sized + 'static
+ {
+ Or::new(Box::new(self), Box::new(Or::new(other, other2)))
+ }
+
fn and(self, other: Box<Filter>) -> And
where Self: Sized + 'static
{
And::new(Box::new(self), other)
}
+ fn and3(self, other: Box<Filter>, other2: Box<Filter>) -> And
+ where Self: Sized + 'static
+ {
+ And::new(Box::new(self), Box::new(And::new(other, other2)))
+ }
+
}