Pass config as reference
This commit is contained in:
parent
7c82aa6623
commit
240069f42c
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ pub struct Config {
|
||||||
impl Config {
|
impl Config {
|
||||||
fn new(raw: Value) -> Config {
|
fn new(raw: Value) -> Config {
|
||||||
return Config {
|
return Config {
|
||||||
input: read::get_input_files(raw),
|
input: read::get_input_files(&raw),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub fn read() -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn get_input_files(conf: Value) -> Vec<PathBuf> {
|
pub fn get_input_files(conf: &Value) -> Vec<PathBuf> {
|
||||||
let working_dir = current_dir().unwrap();
|
let working_dir = current_dir().unwrap();
|
||||||
let input_values = conf.get("input").unwrap().as_sequence().unwrap().to_vec();
|
let input_values = conf.get("input").unwrap().as_sequence().unwrap().to_vec();
|
||||||
return input_values.into_iter().map(|x| working_dir.join(x.as_str().unwrap().to_string())).collect();
|
return input_values.into_iter().map(|x| working_dir.join(x.as_str().unwrap().to_string())).collect();
|
||||||
|
|
Reference in a new issue