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

Implement Copy for the primitive value deserializers #1287

Closed
dtolnay opened this issue May 26, 2018 · 1 comment
Closed

Implement Copy for the primitive value deserializers #1287

dtolnay opened this issue May 26, 2018 · 1 comment

Comments

@dtolnay
Copy link
Member

dtolnay commented May 26, 2018

https://docs.serde.rs/serde/de/value/index.html

The primitive deserializers (I8Deserializer, I16Deserializer, etc) only wrap only wrap a value of their primitive type and a phantom data for the error type, so it should be fine to allow copying.

@dtolnay
Copy link
Member Author

dtolnay commented May 26, 2018

As part of this it would be good to remove the E: Clone bounds inferred by derive(Clone). The bound is not required because these types only store PhantomData<E>.

- impl<E: Clone> Clone for BoolDeserializer<E>
+ impl<E> Clone for BoolDeserializer<E>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant