Skip to content

Commit

Permalink
review fix: use map_or_elsefor new_address macro in `test_scan_fo…
Browse files Browse the repository at this point in the history
…r_new_addresses`
  • Loading branch information
shamardy committed Nov 1, 2024
1 parent c1bd345 commit 5691d8b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mm2src/coins/utxo/utxo_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4000,12 +4000,9 @@ fn test_scan_for_new_addresses() {
address: $address.to_string(),
derivation_path: RpcDerivationPath(DerivationPath::from_str($der_path).unwrap()),
chain: $chain,
balance: match $balance {
Some(balance) => {
HashMap::from([(TEST_COIN_NAME.to_string(), CoinBalance::new(BigDecimal::from(balance)))])
},
None => HashMap::default(),
},
balance: $balance.map_or_else(HashMap::default, |balance| {
HashMap::from([(TEST_COIN_NAME.to_string(), CoinBalance::new(BigDecimal::from(balance)))])
}),
});
}};
}
Expand Down

0 comments on commit 5691d8b

Please sign in to comment.