Remove if-else by map()
This commit is contained in:
parent
29be4029da
commit
8c7ca95af1
1 changed files with 1 additions and 9 deletions
|
@ -45,15 +45,7 @@ impl<'a> Link<'a> {
|
||||||
/// For interal use only. Load an Link from a store id, if this is actually a Link
|
/// For interal use only. Load an Link from a store id, if this is actually a Link
|
||||||
fn retrieve(store: &'a Store, id: StoreId) -> Result<Option<Link<'a>>> {
|
fn retrieve(store: &'a Store, id: StoreId) -> Result<Option<Link<'a>>> {
|
||||||
store.retrieve(id)
|
store.retrieve(id)
|
||||||
.map(|fle| {
|
.map(|fle| Link::get_link_uri_from_filelockentry(&fle).map(|_| Link { link: fle }))
|
||||||
if let Some(_) = Link::get_link_uri_from_filelockentry(&fle) {
|
|
||||||
Some(Link {
|
|
||||||
link: fle
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.map_err(|e| LE::new(LEK::StoreReadError, Some(Box::new(e))))
|
.map_err(|e| LE::new(LEK::StoreReadError, Some(Box::new(e))))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue