serde_with icon indicating copy to clipboard operation
serde_with copied to clipboard

Bool from anything

Open estk opened this issue 1 year ago • 1 comments

I've been trying to migrate from serde_aux to this lib and having trouble finding the equivalent of serde_aux::deserialize_bool_from_anything.

I was wondering if I'm missing something or if equivalent functionality just doesnt exist here yet.

estk avatar Feb 29 '24 16:02 estk

There is no direct equivalent for this. Most/all conversion types in this crate have a serialization function too. But it is possible to take the code from serde_aux and fill a DeserializeAs implementation with it. Although rewriting it to use a Visitor might help with error reporting.

jonasbb avatar Feb 29 '24 21:02 jonasbb