Merge rust-bitcoin/rust-bitcoin#3323: Update the documentation to indicate that the Display implementation in Amount is unstable

eda87517c0 Update documentation to indicate that the Display implementation in Amount is unstable (Shing Him Ng)

Pull request description:

  From [this comment](https://github.com/rust-bitcoin/rust-bitcoin/issues/2954#issuecomment-2325679334) in #2954, update the documentation to indicate that the Display implementation in Amount is unstable

ACKs for top commit:
  Kixunil:
    ACK eda87517c0
  apoelstra:
    ACK eda87517c0 successfully ran local tests

Tree-SHA512: de761b41696e1f43b1a823b0d8a62ce82ec3247e260b7f2b0253f176224e47da64542889c86b9150a9d1a4e29409008b45882cb16c954cbe601d3c1a0093e3cf
This commit is contained in:
merge-script 2024-09-08 14:15:06 +00:00
commit 4bb93add9e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 5 additions and 1 deletions

View File

@ -1181,10 +1181,14 @@ impl core::iter::Sum for Amount {
/// * Show or hide denomination /// * Show or hide denomination
/// * Dynamically-selected denomination - show in sats if less than 1 BTC. /// * Dynamically-selected denomination - show in sats if less than 1 BTC.
/// ///
/// However this can still be combined with [`fmt::Formatter`] options to precisely control zeros, /// However, this can still be combined with [`fmt::Formatter`] options to precisely control zeros,
/// padding, alignment... The formatting works like floats from `core` but note that precision will /// padding, alignment... The formatting works like floats from `core` but note that precision will
/// **never** be lossy - that means no rounding. /// **never** be lossy - that means no rounding.
/// ///
/// Note: This implementation is currently **unstable**. The only thing that we can promise is that
/// unless the precision is changed, this will display an accurate, human-readable number, and the
/// default serialization (one with unmodified [`fmt::Formatter`] options) will round-trip with [`FromStr`]
///
/// See [`Amount::display_in`] and [`Amount::display_dynamic`] on how to construct this. /// See [`Amount::display_in`] and [`Amount::display_dynamic`] on how to construct this.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Display { pub struct Display {