Workaround API break on private API in Serde 1.0.119 #135
+10
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are using a private API in serde, and they've changed the API in a patch release to remind us this is wrong:
serde-rs/serde@dd1f4b4
That's annoying, but there's no easy viable alternative. This API is used by serde_derive on an untagged enum ( see https://github.com/serde-rs/serde/blob/b0c99ed761d638f2ca2f0437522e6c35ad254d93/serde_derive/src/de.rs#L1627-L1645 ), which is basically what we have.
We can't use serde_derive, because we want specific semantics. The only alternative is re-implementing the
ContentRefDeserializer
andContent
objects, which is clearly worse than depending on this private API.I've asked in Discord and raised serde-rs/serde#1947 to query the serde devs.
Signed-off-by: Richard Whitehouse richard.whitehouse@metaswitch.com