Skip to content

When time::serde::format_description defined submodule::option returns None? #460

Closed Answered by jhpratt
Neutroni asked this question in Question
Discussion options

You must be logged in to vote

Deserializing Option<Date> will be None if the value is null (in JSON — other formats have their own equivalents). When this was brought up before, I was unable to find a way to fall back to None if the value is not present. You'd have to use #[serde(default)] on the field as well. The name may be different, as I'm typing this from memory.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Neutroni
Comment options

Answer selected by Neutroni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants