diff options
author | Till Hoeppner | 2014-11-30 17:51:24 +0100 |
---|---|---|
committer | Till Hoeppner | 2014-11-30 18:59:47 +0100 |
commit | 042f7414c229d1c7f66aef24faa92defb91a78cf (patch) | |
tree | 99ce32649aecb606d6a2d9d8a1d483567e83fc55 /src | |
parent | c19e787b018e4a95924972e5c7d63380abba4237 (diff) | |
download | sersve-042f7414c229d1c7f66aef24faa92defb91a78cf.tar.gz sersve-042f7414c229d1c7f66aef24faa92defb91a78cf.tar.xz sersve-042f7414c229d1c7f66aef24faa92defb91a78cf.zip |
Add minimal configuration
Diffstat (limited to 'src')
-rw-r--r-- | src/sersve.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sersve.rs b/src/sersve.rs index ebc4636..e7e39e2 100644 --- a/src/sersve.rs +++ b/src/sersve.rs @@ -217,6 +217,8 @@ fn main() { matches.opt_str("c").map(|conf_file| { let conf_file = File::open(&Path::new(conf_file)); conf_file.as_ref().map_err::<()>(|e| panic!("{}", e.desc)).unwrap(); + + // cannot if-let, because typesafe errors are helpful let json = match json::from_reader(&mut conf_file.ok().unwrap()) { Ok(Json::Object(o)) => o, _ => panic!("Invalid configuration file. Doesn't contain top-level object.") |