From bc4cb6cdc89f546f3f1599223ce8cf0e12530a08 Mon Sep 17 00:00:00 2001 From: Gavin Thomas Claugus Date: Sun, 14 Aug 2016 14:29:02 -0400 Subject: [PATCH] libimagentryfilter: Delete old filter lib Signed-off-by: Gavin Thomas Claugus --- libimagentryfilter/src/filter.rs | 54 ------------------------------- libimagentryfilter/src/lib.rs | 1 - libimagentryfilter/src/ops/and.rs | 24 -------------- libimagentryfilter/src/ops/mod.rs | 3 -- libimagentryfilter/src/ops/not.rs | 23 ------------- libimagentryfilter/src/ops/or.rs | 24 -------------- 6 files changed, 129 deletions(-) delete mode 100644 libimagentryfilter/src/filter.rs delete mode 100644 libimagentryfilter/src/ops/and.rs delete mode 100644 libimagentryfilter/src/ops/mod.rs delete mode 100644 libimagentryfilter/src/ops/not.rs delete mode 100644 libimagentryfilter/src/ops/or.rs diff --git a/libimagentryfilter/src/filter.rs b/libimagentryfilter/src/filter.rs deleted file mode 100644 index 2d0015a1..00000000 --- a/libimagentryfilter/src/filter.rs +++ /dev/null @@ -1,54 +0,0 @@ -use libimagstore::store::Entry; - -pub use ops::and::And; -pub use ops::not::Not; -pub use ops::or::Or; - -pub trait Filter { - - fn filter(&self, &Entry) -> bool; - - fn not(self) -> Not - where Self: Sized + 'static - { - Not::new(Box::new(self)) - } - - fn or(self, other: Box) -> Or - where Self: Sized + 'static - { - Or::new(Box::new(self), other) - } - - fn or_not(self, other: Box) -> Or - where Self: Sized + 'static - { - self.or(Box::new(Not::new(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))) - } - - fn and_not(self, other: Box) -> And - where Self: Sized + 'static - { - self.and(Box::new(Not::new(other))) - } - -} - diff --git a/libimagentryfilter/src/lib.rs b/libimagentryfilter/src/lib.rs index edcd8120..03cb114d 100644 --- a/libimagentryfilter/src/lib.rs +++ b/libimagentryfilter/src/lib.rs @@ -29,7 +29,6 @@ extern crate libimagentrytag; pub mod cli; pub mod builtin; -pub mod ops; // extended functionality of the crate // these depend on other internal libraries than libimagstore and use the upper core modules for diff --git a/libimagentryfilter/src/ops/and.rs b/libimagentryfilter/src/ops/and.rs deleted file mode 100644 index a05e83f6..00000000 --- a/libimagentryfilter/src/ops/and.rs +++ /dev/null @@ -1,24 +0,0 @@ -use libimagstore::store::Entry; - -use filters::filter::Filter; - -pub struct And { - a: Box>, - b: Box> -} - -impl And { - - pub fn new(a: Box>, b: Box>) -> And { - And { a: a, b: b } - } - -} - -impl Filter for And { - - fn filter(&self, e: &Entry) -> bool { - self.a.filter(e) && self.b.filter(e) - } - -} diff --git a/libimagentryfilter/src/ops/mod.rs b/libimagentryfilter/src/ops/mod.rs deleted file mode 100644 index 668eedc5..00000000 --- a/libimagentryfilter/src/ops/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod and; -pub mod not; -pub mod or; diff --git a/libimagentryfilter/src/ops/not.rs b/libimagentryfilter/src/ops/not.rs deleted file mode 100644 index 452a5fe4..00000000 --- a/libimagentryfilter/src/ops/not.rs +++ /dev/null @@ -1,23 +0,0 @@ -use libimagstore::store::Entry; - -use filters::filter::Filter; - -pub struct Not { - a: Box> -} - -impl Not { - - pub fn new(a: Box>) -> Not { - Not { a: a } - } - -} - -impl Filter for Not { - - fn filter(&self, e: &Entry) -> bool { - !self.a.filter(e) - } - -} diff --git a/libimagentryfilter/src/ops/or.rs b/libimagentryfilter/src/ops/or.rs deleted file mode 100644 index 1f98ac85..00000000 --- a/libimagentryfilter/src/ops/or.rs +++ /dev/null @@ -1,24 +0,0 @@ -use libimagstore::store::Entry; - -use filters::filter::Filter; - -pub struct Or { - a: Box>, - b: Box> -} - -impl Or { - - pub fn new(a: Box>, b: Box>) -> Or { - Or { a: a, b: b } - } - -} - -impl Filter for Or { - - fn filter(&self, e: &Entry) -> bool { - self.a.filter(e) || self.b.filter(e) - } - -}