From 980365097d44fc8ebb8e0b1327058a59ae62a439 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 14 May 2025 12:31:16 +1000 Subject: [PATCH] Fix expecting string for amount types 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. Use a lower case character to start the string. --- units/src/amount/serde.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/units/src/amount/serde.rs b/units/src/amount/serde.rs index fc4ca82e3..4be766058 100644 --- a/units/src/amount/serde.rs +++ b/units/src/amount/serde.rs @@ -230,7 +230,7 @@ pub mod as_sat { type Value = Option; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "An Option<{}64>", X::type_prefix(private::Token)) + write!(formatter, "an Option<{}64>", X::type_prefix(private::Token)) } fn visit_none(self) -> Result @@ -301,7 +301,7 @@ pub mod as_btc { type Value = Option; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "An Option") + write!(formatter, "an Option") } fn visit_none(self) -> Result @@ -372,7 +372,7 @@ pub mod as_str { type Value = Option; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "An Option") + write!(formatter, "an Option") } fn visit_none(self) -> Result