From fa1917ac1752239a3d270e747d4a300fc0c301a5 Mon Sep 17 00:00:00 2001 From: xenofem Date: Thu, 28 Apr 2022 05:25:03 -0400 Subject: [PATCH] prevent deserializer from tripping up on positive integers --- src/state.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index f4b0588..0405245 100644 --- a/src/state.rs +++ b/src/state.rs @@ -29,12 +29,16 @@ pub(crate) mod timestamp { type Value = i64; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "a signed integer") + write!(formatter, "an integer") } fn visit_i64(self, v: i64) -> Result { Ok(v) } + + fn visit_u64(self, v: u64) -> Result { + Ok(v as i64) + } } pub(crate) fn deserialize<'de, D: Deserializer<'de>>(