mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-02 15:26:12 +00:00
Serde: Deserialize units as None on optional value
This commit is contained in:
parent
5a1a80fbff
commit
7d7ceb4539
@ -1288,6 +1288,13 @@ pub mod serde {
|
|||||||
{
|
{
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Deserialize a timestamp in seconds since the epoch
|
||||||
|
fn visit_unit<E>(self) -> Result<Option<DateTime<Utc>>, E>
|
||||||
|
where E: de::Error
|
||||||
|
{
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1579,6 +1586,13 @@ pub mod serde {
|
|||||||
{
|
{
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Deserialize a timestamp in seconds since the epoch
|
||||||
|
fn visit_unit<E>(self) -> Result<Option<DateTime<Utc>>, E>
|
||||||
|
where E: de::Error
|
||||||
|
{
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1866,6 +1880,13 @@ pub mod serde {
|
|||||||
{
|
{
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Deserialize a timestamp in seconds since the epoch
|
||||||
|
fn visit_unit<E>(self) -> Result<Option<DateTime<Utc>>, E>
|
||||||
|
where E: de::Error
|
||||||
|
{
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user