prevent deserializer from tripping up on positive integers
This commit is contained in:
parent
bda6da33e8
commit
fa1917ac17
|
@ -29,12 +29,16 @@ pub(crate) mod timestamp {
|
||||||
type Value = i64;
|
type Value = i64;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(formatter, "a signed integer")
|
write!(formatter, "an integer")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E> {
|
fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E> {
|
||||||
Ok(v)
|
Ok(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E> {
|
||||||
|
Ok(v as i64)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn deserialize<'de, D: Deserializer<'de>>(
|
pub(crate) fn deserialize<'de, D: Deserializer<'de>>(
|
||||||
|
|
Loading…
Reference in a new issue