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

Avoid void-params deserialize errors #1041

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

alexheretic
Copy link
Member

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
Copy link
Member

nrc commented Sep 5, 2018

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