-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected uint error with newtype wrapper #45
Comments
The reason We have two tools for managing this. First there's |
Having a mechanism to detect and handle missing values makes sense, thanks! However this default behavior for Option is very surprising, Rust (serde)1, Swift2, and Go3 all support deserializing both I think optionality is orthogonal to defaults, when I want a default value in Rust I use the Footnotes |
Hello!
I have a newtype wrapper around a u64 like so:
When I attempt to
hydrate
it from a doc with a value present for that key, I get the errorunexpected uint
.I think this is because Option::hydrate calls Date::hydrate_uint but the derive impl for a newtype struct only generates Hydrate::hydrate. Is there a better way to accomplish what I'm trying to do here?
And as a larger meta question, why isn't the Hydrate impl for Option simply something like this that handles both missing and explicitly null values?
The text was updated successfully, but these errors were encountered: