From 3658865a18ed875704c28fa47358a610bf266ae5 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 14 May 2025 12:28:49 +1000 Subject: [PATCH] Fix expecting string for fee_rate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the `serde` docs: > This is used in error messages. The message should complete the > sentence “This Visitor expects to receive …”, for example the message > could be “an integer between 0 and 64”. The message should not be > capitalized and should not end with a period. However we have the `expecting` str using the converted type not the thing the visitor expects. Use `u64` instead of `FeeRate` since that is what is being parsed. Note that in `amount` we got it _almost_ correct, subsequent patch will fix the case. --- units/src/fee_rate/serde.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/units/src/fee_rate/serde.rs b/units/src/fee_rate/serde.rs index 283a1c2c1..ae2e2fb8f 100644 --- a/units/src/fee_rate/serde.rs +++ b/units/src/fee_rate/serde.rs @@ -69,7 +69,7 @@ pub mod as_sat_per_kwu { type Value = Option; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "An Option") + write!(f, "an Option") } fn visit_none(self) -> Result @@ -140,7 +140,7 @@ pub mod as_sat_per_vb_floor { type Value = Option; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "An Option") + write!(f, "an Option") } fn visit_none(self) -> Result @@ -211,7 +211,7 @@ pub mod as_sat_per_vb_ceil { type Value = Option; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "An Option") + write!(f, "an Option") } fn visit_none(self) -> Result