use ::new standard
This commit is contained in:
parent
68f7233cd9
commit
2dd56871ef
1 changed files with 4 additions and 6 deletions
|
@ -10,17 +10,15 @@ pub struct Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
|
fn new(raw: String) -> Config {
|
||||||
|
return serde_yaml::from_str(&raw).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn construct(data: String) -> Config {
|
|
||||||
return serde_yaml::from_str(&data).unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn get_config() {
|
pub fn get_config() {
|
||||||
let config_str = read::read();
|
let config_str = read::read();
|
||||||
let config = construct(config_str);
|
let config = Config::new(config_str);
|
||||||
println!("{:?}", config);
|
println!("{:?}", config);
|
||||||
validate::validate(config);
|
validate::validate(config);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue