Merge pull request #402 from matthiasbeyer/libimagrt/code-cleanup

Code cleanup in libimagrt
This commit is contained in:
Matthias Beyer 2016-05-17 00:20:23 +02:00
commit 46e4e04156

View file

@ -70,25 +70,21 @@ impl<'a> Runtime<'a> {
spath spath
}, PathBuf::from); }, PathBuf::from);
let cfg = Configuration::new(&rtp); let cfg = match Configuration::new(&rtp) {
let cfg = if cfg.is_err() { Err(e) => if e.err_type() != ConfigErrorKind::NoConfigFileFound {
let e = cfg.unwrap_err();
if e.err_type() != ConfigErrorKind::NoConfigFileFound {
let cause : Option<Box<Error>> = Some(Box::new(e)); let cause : Option<Box<Error>> = Some(Box::new(e));
return Err(RuntimeError::new(RuntimeErrorKind::Instantiate, cause)); return Err(RuntimeError::new(RuntimeErrorKind::Instantiate, cause));
} else { } else {
trace_error(&e); trace_error(&e);
None None
} },
} else {
Some(cfg.unwrap()) Ok(cfg) => Some(cfg),
}; };
let store_config = { let store_config = match cfg {
match cfg { Some(ref c) => c.store_config().cloned(),
Some(ref c) => c.store_config().cloned(), None => None,
None => None,
}
}; };
if is_debugging { if is_debugging {