Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Avoid void-params deserialize errors#1041

Merged
nrc merged 1 commit into
rust-lang:masterfrom
alexheretic:permissive-void-param-requests
Sep 5, 2018
Merged

Avoid void-params deserialize errors#1041
nrc merged 1 commit into
rust-lang:masterfrom
alexheretic:permissive-void-param-requests

Conversation

@alexheretic

Copy link
Copy Markdown
Contributor

This change moves to permissive deserialisation of request void-params. Currently if a client sends a requests with non-null params, ie a {}, we error. But in the case the params end up as () we're better served just continuing.

Technically this was actually more of a pain than it seemed. With our use of generics it's not easy to tell if params are (). Without specialisation I can't add an additional implementation for void param requests.

Instead I used size_of<R::Params> == 0 to deduce that the params are void-type and put in a workaround.

Fixes #1038

@nrc nrc merged commit 4b61cf0 into rust-lang:master Sep 5, 2018
@nrc

nrc commented Sep 5, 2018

Copy link
Copy Markdown
Member

Nice, thanks! That's a pretty glorious hack!

@alexheretic alexheretic deleted the permissive-void-param-requests branch September 5, 2018 22:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants