Closed juntyr closed 1 year ago
@torkleyy This is quite an annoying bug and I am not sure if this is the right way forward to fix it. The problem is that RawValue
will have to be annoying in one of two ways:
a) RawValue::from_ron("/*hi*/ 42 /*bye*/")
works as expected (i.e. any valid ron, except for attributes, can be used in the constructor and will be pasted literally into the output). However, deserialising only roundtrips if no pretty serialising is used since any pretty whitespace or comments will be eaten up by the raw value upon the next deserialising. I'm going with this option right now.
b) RawValue::from_ron("/*hi*/ ( /*yay*/ 42 /*lol*/ ) /*bye*/")
only keeps ( /*yay*/ 42 /*lol*/ )
(so all whitespace before and after the first non-whitespace is lost), but roundtripping works since additional pretty whitespace is dropped.
Which one would you prefer?
Patch coverage: 100.00%
and project coverage change: +0.04%
:tada:
Comparison is base (
a293382
) 95.27% compared to head (6abc432
) 95.32%.
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Approach a seems like the better one, yeah.
CHANGELOG.md