Merge rust-bitcoin/rust-bitcoin#784: replace unncessary closure with function pointer in FromStr::from_str for Deonomation

8fef869c15 repalce unncessary extra closure with function pointer in starts_with_uppercase closure inside Denomination from_str (KaFai Choi)

Pull request description:

  Follow-up PR from https://github.com/rust-bitcoin/rust-bitcoin/pull/768

  https://github.com/rust-bitcoin/rust-bitcoin/pull/768#discussion_r784684641

ACKs for top commit:
  apoelstra:
    ACK 8fef869c15
  dr-orlovsky:
    ACK 8fef869c15

Tree-SHA512: 3fd7d77805e047a692c53ca7677d7857baa00f529e15696790544a47cebe8a143c1c11f95401436d5322b6da24bc61cc9982a069c883b4815b6c50e8bd31553e
This commit is contained in:
Dr. Maxim Orlovsky 2022-01-15 00:30:08 +02:00
commit 17c3547add
No known key found for this signature in database
GPG Key ID: AF91255DEA466640
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ impl FromStr for Denomination {
use self::ParseAmountError::*;
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) {
None => Err(UnknownDenomination(s.to_owned())),
Some(D::MilliBitcoin) | Some(D::PicoBitcoin) | Some(D::MilliSatoshi) if starts_with_uppercase() => {