-
I need to use a web interface giving a JSON object. Converting to Rust, would be:
The interface actually uses empty Vec when there is nothing for the field, but for reason unknown, the author made So I wonder if I could do something like:
|
Beta Was this translation helpful? Give feedback.
Answered by
jonasbb
Nov 3, 2024
Replies: 1 comment 1 reply
-
I think your use case is covered by A general post-processing like this is not really feasible outside |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Magicloud
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think your use case is covered by
DefaultOnNull
.A general post-processing like this is not really feasible outside
serde_derive
. Functions are not generic types, so you cannot have aPostProcess<unwrap_or_default>
or similar.