Merge pull request #277 from matthiasbeyer/libimagstore/remove-unused-aspects

Libimagstore/remove unused aspects
This commit is contained in:
Matthias Beyer 2016-03-26 13:55:46 +01:00
commit 0a181479c8
3 changed files with 0 additions and 28 deletions

View file

@ -126,14 +126,6 @@ pub fn config_is_valid(config: &Option<Value>) -> bool {
}
}
pub fn get_pre_read_aspect_names(value: &Option<Value>) -> Vec<String> {
get_aspect_names_for_aspect_position("pre-read-hook-aspects", value)
}
pub fn get_post_read_aspect_names(value: &Option<Value>) -> Vec<String> {
get_aspect_names_for_aspect_position("post-read-hook-aspects", value)
}
pub fn get_pre_create_aspect_names(value: &Option<Value>) -> Vec<String> {
get_aspect_names_for_aspect_position("pre-create-hook-aspects", value)
}

View file

@ -1,7 +1,5 @@
#[derive(Debug, Clone)]
pub enum HookPosition {
PreRead,
PostRead,
PreCreate,
PostCreate,
PreRetrieve,

View file

@ -116,8 +116,6 @@ pub struct Store {
* Registered hooks
*/
pre_read_aspects : Arc<Mutex<Vec<Aspect>>>,
post_read_aspects : Arc<Mutex<Vec<Aspect>>>,
pre_create_aspects : Arc<Mutex<Vec<Aspect>>>,
post_create_aspects : Arc<Mutex<Vec<Aspect>>>,
pre_retrieve_aspects : Arc<Mutex<Vec<Aspect>>>,
@ -165,18 +163,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());
@ -228,8 +214,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)),
@ -431,8 +415,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(),