From fea908c8afe21946bb587e6e610bff8621b53f4e Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 1 Sep 2022 16:52:29 +1000 Subject: [PATCH] Add private::Sealed trait bound to SerdeAmount As suggested by the todo seal the `SerdeAmount` so users of the library explicitly cannot implement it. Its not obvious to me why this wasn't done at the time. Remove the associated TODO from the code. --- src/util/amount.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/amount.rs b/src/util/amount.rs index 9813c977..88fab77b 100644 --- a/src/util/amount.rs +++ b/src/util/amount.rs @@ -1281,9 +1281,7 @@ pub mod serde { /// This trait is used only to avoid code duplication and naming collisions /// of the different serde serialization crates. - /// - /// TODO: Add the private::Sealed bound in next breaking release - pub trait SerdeAmount: Copy + Sized { + pub trait SerdeAmount: Copy + Sized + private::Sealed { fn ser_sat(self, s: S) -> Result; fn des_sat<'d, D: Deserializer<'d>>(d: D) -> Result; fn ser_btc(self, s: S) -> Result;