Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround API break on private API in Serde 1.0.119 #135

Merged
merged 6 commits into from
Jan 12, 2021
Merged

Conversation

richardwhiuk
Copy link
Contributor

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 and Content 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 [email protected]

Signed-off-by: Richard Whitehouse <[email protected]>
Signed-off-by: Richard Whitehouse <[email protected]>
Signed-off-by: Richard Whitehouse <[email protected]>
@richardwhiuk richardwhiuk force-pushed the serde-breakage branch 3 times, most recently from a8d6f4b to 4a35df8 Compare January 12, 2021 10:02
RUSTFMT=1 changes the binary used by cargo fmt - see
rust-lang/rustfmt#4419

Signed-off-by: Richard Whitehouse <[email protected]>
Signed-off-by: Richard Whitehouse <[email protected]>
@richardwhiuk
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 12, 2021

Build succeeded:

@bors bors bot merged commit fc9928a into master Jan 12, 2021
@bors bors bot deleted the serde-breakage branch January 12, 2021 11:41
richardwhiuk added a commit that referenced this pull request Jan 18, 2021
135: Workaround API break on private API in Serde 1.0.119 r=richardwhiuk a=richardwhiuk

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` and `Content` 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 <[email protected]>
Co-authored-by: Richard Whitehouse <[email protected]>
richardwhiuk added a commit that referenced this pull request Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant