Implement 3-{and,or} variants

This commit is contained in:
Matthias Beyer 2016-02-02 17:54:02 +01:00
parent 41564a7d8e
commit d4cee5459f

View file

@ -20,11 +20,23 @@ pub trait Filter {
Or::new(Box::new(self), other) 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 fn and(self, other: Box<Filter>) -> And
where Self: Sized + 'static where Self: Sized + 'static
{ {
And::new(Box::new(self), other) 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)))
}
} }