repalce unncessary extra closure with function pointer in starts_with_uppercase closure inside Denomination from_str

This commit is contained in:
KaFai Choi 2022-01-14 19:48:31 +07:00
parent b165b8da05
commit 8fef869c15
No known key found for this signature in database
GPG Key ID: C93944C459E21542
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ impl FromStr for Denomination {
use self::ParseAmountError::*; use self::ParseAmountError::*;
use self::Denomination as D; use self::Denomination as D;
let starts_with_uppercase = || s.starts_with(|ch: char| ch.is_uppercase()); let starts_with_uppercase = || s.starts_with(char::is_uppercase);
match denomination_from_str(s) { match denomination_from_str(s) {
None => Err(UnknownDenomination(s.to_owned())), None => Err(UnknownDenomination(s.to_owned())),
Some(D::MilliBitcoin) | Some(D::PicoBitcoin) | Some(D::MilliSatoshi) if starts_with_uppercase() => { Some(D::MilliBitcoin) | Some(D::PicoBitcoin) | Some(D::MilliSatoshi) if starts_with_uppercase() => {