Replace matching with function chaining
This commit is contained in:
parent
a9135a80fb
commit
c1ff2b14f0
1 changed files with 2 additions and 7 deletions
|
@ -90,13 +90,8 @@ impl<'a> BookmarkCollection<'a> {
|
||||||
.and_then(|id| store.get(id))
|
.and_then(|id| store.get(id))
|
||||||
.chain_err(|| BEK::StoreReadError)
|
.chain_err(|| BEK::StoreReadError)
|
||||||
.and_then(|fle| {
|
.and_then(|fle| {
|
||||||
match fle {
|
fle.ok_or(BE::from_kind(BEK::CollectionNotFound))
|
||||||
None => Err(BE::from_kind(BEK::CollectionNotFound)),
|
.map(|e| BookmarkCollection { fle: e, store: store })
|
||||||
Some(e) => Ok(BookmarkCollection {
|
|
||||||
fle: e,
|
|
||||||
store: store,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue