reorganze a bit
This commit is contained in:
parent
3f622cda5b
commit
3fced5e6a8
1 changed files with 12 additions and 2 deletions
14
src/main.rs
14
src/main.rs
|
@ -19,8 +19,16 @@ fn main() {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
println!("Config path: {}", config_path.to_str().unwrap());
|
||||
match run(config_path) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
println!("{}", e);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn run(config_path: PathBuf) -> Result<(), Error> {
|
||||
let config: Config;
|
||||
|
||||
match get_config_from_path(config_path) {
|
||||
|
@ -28,11 +36,13 @@ fn main() {
|
|||
config = conf;
|
||||
}
|
||||
Err(e) => {
|
||||
panic!("{}", e);
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
|
||||
println!("{:?}", config);
|
||||
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
fn get_config_from_path(path: PathBuf) -> Result<Config, Error> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue