diff --git a/src/build/process.rs b/src/build/process.rs index e2c8f84..d651d62 100644 --- a/src/build/process.rs +++ b/src/build/process.rs @@ -1,13 +1,10 @@ use config::Config; -use processors::html_cleanup::html_cleanup; -use processors::strip_blank::strip_blank; +use processors::PROCESSORS; pub fn render(config: Config, input: String) -> Result { let mut rendered_input = input; - let renderers: Vec Result> = - vec![html_cleanup, strip_blank]; - for renderer in renderers { + for renderer in PROCESSORS.into_iter() { rendered_input = try!(renderer(config.clone(), rendered_input)); } return Ok(rendered_input); diff --git a/src/processors/mod.rs b/src/processors/mod.rs index 96db238..087eb97 100644 --- a/src/processors/mod.rs +++ b/src/processors/mod.rs @@ -1,2 +1,8 @@ +use config::Config; + pub mod html_cleanup; pub mod strip_blank; + + +pub const PROCESSORS: [fn(Config, String) -> Result; 2] = + [html_cleanup::html_cleanup, strip_blank::strip_blank];