From eda87517c0e46ee81d45285656ea6245f91bb754 Mon Sep 17 00:00:00 2001 From: Shing Him Ng Date: Sat, 7 Sep 2024 11:53:16 -0500 Subject: [PATCH] Update documentation to indicate that the Display implementation in Amount is unstable --- units/src/amount.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/units/src/amount.rs b/units/src/amount.rs index 8f8733130..a8ac1f202 100644 --- a/units/src/amount.rs +++ b/units/src/amount.rs @@ -1181,10 +1181,14 @@ impl core::iter::Sum for Amount { /// * Show or hide denomination /// * 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 /// **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. #[derive(Debug, Clone)] pub struct Display {