serde_as
with smallvec::SmallVec
#654
-
In v1, I used to be able to do #[derive(Deserialize)]
#[serde(transparent)]
struct Quix {
#[serde(with = "serde_with::rust::tuple_list_as_map")]
foo: SmallVec<[(Bar, Baz); 7]>,
} using serde_with::rust::tuple_list_as_map use serde_with::{serde_as, Map};
#[serde_as]
#[derive(Deserialize)]
#[serde(transparent)]
struct Quix {
#[serde_as(as = "Map<_, _>")]
foo: Vec<(Bar, Baz)>,
} The above works for Is there any way to work around that on newer versions and restore functionality of all |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yes that is an unfortunate effect of the change. the The problem is with unspecified generics, mainly during deserialization. For example, the |
Beta Was this translation helpful? Give feedback.
-
I would be interested in making that PR sometime. |
Beta Was this translation helpful? Give feedback.
I would be interested in making that PR sometime.
However, I am curious to confirm whether you think exposing some such functions/modules that can be used with
serde(with=
would be inappropriate and not something you'd want for this library.