Refactor: Use function chaining and new error type link
This commit is contained in:
parent
1e2ac14d3b
commit
dac817f318
2 changed files with 4 additions and 7 deletions
|
@ -30,6 +30,7 @@ error_chain! {
|
|||
|
||||
foreign_links {
|
||||
TomlQueryError(::toml_query::error::Error);
|
||||
UrlError(::url::ParseError);
|
||||
}
|
||||
|
||||
errors {
|
||||
|
|
|
@ -641,13 +641,9 @@ pub mod store_check {
|
|||
let mut map = HashMap::new();
|
||||
for element in iter {
|
||||
debug!("Checking element = {:?}", element);
|
||||
let entry = match element? {
|
||||
Some(e) => e,
|
||||
None => {
|
||||
let e = String::from("TODO: Not yet handled");
|
||||
return Err(e).map_err(From::from);
|
||||
},
|
||||
};
|
||||
let entry = element?.ok_or_else(|| {
|
||||
LE::from(String::from("TODO: Not yet handled"))
|
||||
})?;
|
||||
|
||||
debug!("Checking entry = {:?}", entry.get_location());
|
||||
|
||||
|
|
Loading…
Reference in a new issue