serde-rs / serde-rs.github.io

https://serde.rs
Creative Commons Attribution Share Alike 4.0 International
22 stars 96 forks source link

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

Open kosta opened 4 years ago

kosta commented 4 years ago

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 commented 4 years ago

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