Closed juntyr closed 1 year ago
Patch coverage: 97.50
% and project coverage change: -0.24
:warning:
Comparison is base (
484fcab
) 87.06% compared to head (bcbb027
) 86.83%.:exclamation: Current head bcbb027 differs from pull request most recent head 775c39d. Consider uploading reports for the commit 775c39d to get more accurate results
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Supersedes #403, #453, and #454 to add minimal support for
#[serde(flatten)]
in RON. Instead of many workarounds to make flattened structs serialise into nice RON struct syntax and deserialise from them, both of which are really difficult since serde gives us no information to work with and just delegates to map serialisation/deserialisation, this PR just ensures that at least flattened structs can roundtrip through RON.For this, just one hack is necessary. If we detect that a map is deserialised into what looks like a struct (thanks @clouds56 for contributing the detection in #454), we enforce that map key identifiers are actually strings written exactly as
"
, identifier,"
. This seems to be enough to get the tests to work that I initially designed for https://github.com/ron-rs/ron/pull/403.@torkleyy I'd be in favour of landing this instead of going down the rabbit hole of https://github.com/ron-rs/ron/pull/403 since that just fixes one of the two parts and getting flattened structs to serialise correctly would require hacks of another order.
This would not really fix https://github.com/ron-rs/ron/issues/115 but at least get some working if imperfect solution.
CHANGELOG.md