aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTill Hoeppner2014-11-30 17:51:24 +0100
committerTill Hoeppner2014-11-30 18:59:47 +0100
commit042f7414c229d1c7f66aef24faa92defb91a78cf (patch)
tree99ce32649aecb606d6a2d9d8a1d483567e83fc55 /src
parentc19e787b018e4a95924972e5c7d63380abba4237 (diff)
downloadsersve-042f7414c229d1c7f66aef24faa92defb91a78cf.tar.gz
sersve-042f7414c229d1c7f66aef24faa92defb91a78cf.tar.xz
sersve-042f7414c229d1c7f66aef24faa92defb91a78cf.zip
Add minimal configuration
Diffstat (limited to 'src')
-rw-r--r--src/sersve.rs2
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.")