From 298df33274560a6f23702e0bae67ad9c75e9d692 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 19 Jul 2017 19:54:10 +0100 Subject: [PATCH] Set output in config --- src/config/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index e85c2b1..096d98d 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1,6 +1,7 @@ use serde_yaml; use serde_yaml::Value; use std::path::PathBuf; +use std::collections::HashMap; pub mod read; pub mod validate; @@ -8,13 +9,15 @@ pub mod consts; #[derive(Debug, Serialize, Deserialize, Default)] pub struct Config { - input: Vec + input: Vec, + output: HashMap } impl Config { fn new(raw: Value) -> Config { return Config { input: read::get_input_files(&raw), + output: read::get_output_files(&raw), ..Default::default() }; } @@ -25,6 +28,5 @@ pub fn get_config() -> Config { let config_str = read::read(); let config_value: Value = serde_yaml::from_str(&config_str).unwrap(); validate::validate(&config_value).expect("Validation Error"); - read::get_output_files(&config_value); - return Config::new(config_value); + return Config::new(config_value); }