filter_map instead of unwrap
This commit is contained in:
parent
dc037e663a
commit
ac2f518174
@ -240,7 +240,7 @@ pub async fn user_balance_post(
|
||||
|
||||
let uncle_hashes: HashSet<_> = uncle_hashes
|
||||
.into_iter()
|
||||
.map(|x| serde_json::from_str(x.block_hash.as_str()).unwrap())
|
||||
.filter_map(|x| serde_json::from_str(x.block_hash.as_str()).ok())
|
||||
.collect();
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user