Fix: If the field is not available, return false
The function is for checking whether a flag is set. If the flag is not available, the flag is obviously not set. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
a6ad19a14f
commit
84c6a1981e
2 changed files with 2 additions and 2 deletions
|
@ -81,7 +81,7 @@ impl Is for ::libimagstore::store::Entry {
|
||||||
|
|
||||||
match self.get_header().read_bool(field).map_err(Error::from)? {
|
match self.get_header().read_bool(field).map_err(Error::from)? {
|
||||||
Some(b) => Ok(b),
|
Some(b) => Ok(b),
|
||||||
None => Err(format_err!("Field {} not available", field)),
|
None => Ok(false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
extern crate filters;
|
extern crate filters;
|
||||||
extern crate toml;
|
extern crate toml;
|
||||||
extern crate toml_query;
|
extern crate toml_query;
|
||||||
#[macro_use] extern crate failure;
|
extern crate failure;
|
||||||
|
|
||||||
extern crate libimagstore;
|
extern crate libimagstore;
|
||||||
extern crate libimagerror;
|
extern crate libimagerror;
|
||||||
|
|
Loading…
Reference in a new issue