diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-05-09 17:12:55 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-05-09 17:12:55 +0200 |
commit | 987605322f5ee8c97b2ad568bab777168f7b3f9a (patch) | |
tree | 58e727102239dc0b943966af5a762e6009327743 /libimagrt | |
parent | 285832f45f235aff8d1e741ea8f481bde8cc2e28 (diff) |
Add missing "return None" in file opening error case
Diffstat (limited to 'libimagrt')
-rw-r--r-- | libimagrt/src/configuration.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libimagrt/src/configuration.rs b/libimagrt/src/configuration.rs index 0913d90a..eb199a53 100644 --- a/libimagrt/src/configuration.rs +++ b/libimagrt/src/configuration.rs @@ -244,13 +244,16 @@ fn fetch_config(rtp: &PathBuf) -> Result<Value> { let mut s = String::new(); let f = File::open(path); if f.is_err() { + return None } let mut f = f.unwrap(); f.read_to_string(&mut s).ok(); s }; + let mut parser = Parser::new(&content[..]); let res = parser.parse(); + if res.is_none() { write!(stderr(), "Config file parser error:").ok(); for error in parser.errors { |