From 797a707c8e596318ce8487cd38620608166c5f19 Mon Sep 17 00:00:00 2001 From: Kai Sickeler Date: Fri, 25 Mar 2016 13:18:59 +0100 Subject: [PATCH 1/2] removed unused Pre- / PostRead aspects --- libimagstore/src/hook/position.rs | 2 -- libimagstore/src/store.rs | 18 ------------------ 2 files changed, 20 deletions(-) diff --git a/libimagstore/src/hook/position.rs b/libimagstore/src/hook/position.rs index be289818..f4a44c8c 100644 --- a/libimagstore/src/hook/position.rs +++ b/libimagstore/src/hook/position.rs @@ -1,7 +1,5 @@ #[derive(Debug)] pub enum HookPosition { - PreRead, - PostRead, PreCreate, PostCreate, PreRetrieve, diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index af10869e..d52dd237 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -111,8 +111,6 @@ pub struct Store { * Registered hooks */ - pre_read_aspects : Arc>>, - post_read_aspects : Arc>>, pre_create_aspects : Arc>>, post_create_aspects : Arc>>, pre_retrieve_aspects : Arc>>, @@ -160,18 +158,6 @@ impl Store { } } - let pre_read_aspects = get_pre_read_aspect_names(&store_config) - .into_iter().map(|n| { - let cfg = AspectConfig::get_for(&store_config, n.clone()); - Aspect::new(n, cfg) - }).collect(); - - let post_read_aspects = get_post_read_aspect_names(&store_config) - .into_iter().map(|n| { - let cfg = AspectConfig::get_for(&store_config, n.clone()); - Aspect::new(n, cfg) - }).collect(); - let pre_create_aspects = get_pre_create_aspect_names(&store_config) .into_iter().map(|n| { let cfg = AspectConfig::get_for(&store_config, n.clone()); @@ -223,8 +209,6 @@ impl Store { let store = Store { location: location, configuration: store_config, - pre_read_aspects : Arc::new(Mutex::new(pre_read_aspects)), - post_read_aspects : Arc::new(Mutex::new(post_read_aspects)), pre_create_aspects : Arc::new(Mutex::new(pre_create_aspects)), post_create_aspects : Arc::new(Mutex::new(post_create_aspects)), pre_retrieve_aspects : Arc::new(Mutex::new(pre_retrieve_aspects)), @@ -421,8 +405,6 @@ impl Store { debug!(" with aspect: {:?}", aspect_name); let guard = match position { - HookPosition::PreRead => self.pre_read_aspects.clone(), - HookPosition::PostRead => self.post_read_aspects.clone(), HookPosition::PreCreate => self.pre_create_aspects.clone(), HookPosition::PostCreate => self.post_create_aspects.clone(), HookPosition::PreRetrieve => self.pre_retrieve_aspects.clone(), From cdbc0ceae5f3ca93fd206afb31886d016cef1642 Mon Sep 17 00:00:00 2001 From: Kai Sickeler Date: Fri, 25 Mar 2016 13:19:00 +0100 Subject: [PATCH 2/2] Removed unused functions --- libimagstore/src/configuration.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libimagstore/src/configuration.rs b/libimagstore/src/configuration.rs index 4098e5e6..1522ed38 100644 --- a/libimagstore/src/configuration.rs +++ b/libimagstore/src/configuration.rs @@ -126,14 +126,6 @@ pub fn config_is_valid(config: &Option) -> bool { } } -pub fn get_pre_read_aspect_names(value: &Option) -> Vec { - get_aspect_names_for_aspect_position("pre-read-hook-aspects", value) -} - -pub fn get_post_read_aspect_names(value: &Option) -> Vec { - get_aspect_names_for_aspect_position("post-read-hook-aspects", value) -} - pub fn get_pre_create_aspect_names(value: &Option) -> Vec { get_aspect_names_for_aspect_position("pre-create-hook-aspects", value) }