You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(ofc. changing Spanned<String> to just String works.)
I think the underlying reason is that using an enum (at least in the way presented above) gets expanded by Serde into a call to deserialize_any(), which later makes this boi:
serde_derive, when deserializing untagged enums and internally tagged enums, buffers into a Content enum. This buffering loses all context of what we are deserializing into so we don't know we can attempt Spanned. We can't even retry with spanned on error because the deserializing of Content will be happening later.
True; for what it's worth, in my concrete use case the tag is always the first field, so using a custom deserializer works pretty well - adjusted for the example above, it would say:
Hi,
Following test fails:
... saying:
(ofc. changing
Spanned<String>
to justString
works.)I think the underlying reason is that using an enum (at least in the way presented above) gets expanded by Serde into a call to
deserialize_any()
, which later makes this boi:toml/crates/toml_edit/src/de/value.rs
Line 55 in 9e43da1
... unaware of the "spanned" context it's being invoked on 😢
See also
flatten
#589 forflatten
The text was updated successfully, but these errors were encountered: