Skip to content

Commit 7dd004b

Browse files
committed
Merge rust-bitcoin#3741: Clean up possibly confusing
60f2089 Clean up possibly confusing (Tobin C. Harding) Pull request description: Put the list of possibly confusing forms in the same order as the enum and fix the rustdocs to show the actual error variants returned. ACKs for top commit: apoelstra: ACK 60f2089; successfully ran local tests Tree-SHA512: 109fd3e9b72860c3e2a1268aeafab30d6b2b6fac5d5835db6c216a434b9e175911e6445c187f6b80ab2d8c54184df9338230985a4e030aa146cd9fa410971216
2 parents ea6bf12 + 60f2089 commit 7dd004b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

units/src/amount/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl Denomination {
126126

127127
/// These form are ambigous and could have many meanings. For example, M could denote Mega or Milli.
128128
/// If any of these forms are used, an error type PossiblyConfusingDenomination is returned.
129-
const CONFUSING_FORMS: [&str; 6] = ["MBTC", "Mbtc", "CBTC", "Cbtc", "UBTC", "Ubtc"];
129+
const CONFUSING_FORMS: [&str; 6] = ["CBTC", "Cbtc", "MBTC", "Mbtc", "UBTC", "Ubtc"];
130130

131131
impl fmt::Display for Denomination {
132132
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(self.as_str()) }
@@ -139,10 +139,9 @@ impl FromStr for Denomination {
139139
///
140140
/// # Errors
141141
///
142-
/// - If the denomination begins with a capital `M` a [`PossiblyConfusingDenominationError`] is
143-
/// returned.
144-
///
145-
/// - If an unknown denomination is used, an [`UnknownDenominationError`] is returned.
142+
/// - [`ParseDenominationError::PossiblyConfusing`]: If the denomination begins with a capital
143+
/// letter that could be confused with centi, milli, or micro-bitcoin.
144+
/// - [`ParseDenominationError::Unknown`]: If an unknown denomination is used.
146145
fn from_str(s: &str) -> Result<Self, Self::Err> {
147146
use self::ParseDenominationError::*;
148147

0 commit comments

Comments
 (0)