Skip to content
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

(De)serializing any type from a (de)serializable type #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kosta
Copy link

@kosta kosta commented Mar 9, 2020

I found myself relying on this trick again today but couldn't find it documented anywhere.

It kind of follows from the design of serde, but I suspect there are a lot of users that are not aware of this and might do something more complicated, e.g. implement a Visitor like described in the docs.

kosta and others added 3 commits March 9, 2020 23:46
I found myself relying on this trick again today but couldn't find it documented anywhere.

It kind of follows from the design of serde, but I suspect there are a lot of users that are not aware of this and might do something more complicated, e.g. implement a Visitor like described in the docs.
@kosta
Copy link
Author

kosta commented Mar 10, 2020

Travis panics, but I don't really understand where the panic comes from. Got a hint?

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error in travis is:

error: cannot find attribute `serde` in this scope
  --> /tmp/rust-skeptic.yuaqpH38o0J0/test.rs:14:7
   |
14 |     #[serde(deserialize_with="deserialize_atomic_u64")]
   |       ^^^^^

error: aborting due to previous error

test deserializing_any_type_from_deserializable_type_sect_de_serializing_any_type_from_a_de_serializable_type_line_7 ... FAILED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants