From d4cee5459fec9bf5f90bb2f140134fbf91feec79 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 2 Feb 2016 17:54:02 +0100 Subject: [PATCH] Implement 3-{and,or} variants --- libimagentryfilter/src/filter.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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, other2: Box) -> Or + where Self: Sized + 'static + { + Or::new(Box::new(self), Box::new(Or::new(other, other2))) + } + fn and(self, other: Box) -> And where Self: Sized + 'static { And::new(Box::new(self), other) } + fn and3(self, other: Box, other2: Box) -> And + where Self: Sized + 'static + { + And::new(Box::new(self), Box::new(And::new(other, other2))) + } + }