projects
/
hlquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
310dd8a
)
Use Result::map() instead of matching Err to itself
author
MegaBrutal
<megabrutal+github@megabrutal.com>
Sat, 18 Feb 2023 22:00:00 +0000
(23:00 +0100)
committer
MegaBrutal
<megabrutal+github@megabrutal.com>
Sat, 18 Feb 2023 22:00:00 +0000
(23:00 +0100)
src/main.rs
patch
|
blob
|
history
diff --git
a/src/main.rs
b/src/main.rs
index 90d51c37b78752d8f4625bb2fc44fe45118c0000..f17f6ffb92204d7597fd868e9058a14fbdb381aa 100644
(file)
--- a/
src/main.rs
+++ b/
src/main.rs
@@
-78,10
+78,7
@@
fn main() {
},
Err(e) => Err(HLQueryError::IOError(e))
})
- .map(|addresses| match addresses {
- Ok(iter_addr) => Ok(iter_addr.map(|addr| HLQueryResult::new(&client, addr)).collect()),
- Err(e) => Err(e)
- })
+ .map(|address_group| address_group.map(|addresses| addresses.map(|addr| HLQueryResult::new(&client, addr)).collect()))
.collect();
println!("{}\n", serde_json::to_string_pretty(&query_results).unwrap());