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

Support serde 0.7 #60

Merged
merged 1 commit into from Mar 4, 2016
Merged

Support serde 0.7 #60

merged 1 commit into from Mar 4, 2016

Conversation

@TyOverby
Copy link
Collaborator

TyOverby commented Feb 29, 2016

Closes #55

@nox
Copy link
Member

nox commented Mar 3, 2016

Since power comes with responsibility, need a review? :)

@TyOverby
Copy link
Collaborator Author

TyOverby commented Mar 3, 2016

@nox That would be great! Also, do you know when servo plans on moving to serde-0.7?

@nox
Copy link
Member

nox commented Mar 3, 2016

There is a Webrender workweek ongoing so we are waiting until it finishes to not make their work harder. So next week probably, when we will do a rustup.

Cargo.toml Outdated
@@ -1,6 +1,6 @@
[package]
name = "bincode"
version = "0.4.0"
version = "0.4.1"

This comment has been minimized.

@nox

nox Mar 3, 2016

Member

I think it should be 0.5.0.

This comment has been minimized.

@TyOverby

TyOverby Mar 3, 2016

Author Collaborator

Yep. I don't know how this sneaked in. 0.4.1 was the release that fixed the dependencies. This PR is certainly a breaking change.

EndOfStreamError,
UnknownFieldError,
MissingFieldError,
EndOfStream,

This comment has been minimized.

@nox

nox Mar 3, 2016

Member

serde::de::value::Error has a EndOfStreamError, I don't think there is any need to duplicate it.

This comment has been minimized.

@TyOverby

TyOverby Mar 3, 2016

Author Collaborator

That's true, but outside of serde, you have ByteOrderError::UnexpectedEndOfStream. I thought it would be weird to coerce a ByteOrderError into a serde::de::value::Error, but I could be convinced otherwise.

This comment has been minimized.

@nox

nox Mar 3, 2016

Member

We can very well special case DeserializeError::Serde(de::value::Error::EndOfStreamError), no? I find it weird to have two different EndOfStream errors.

This comment has been minimized.

@TyOverby

TyOverby Mar 3, 2016

Author Collaborator

Yeah, that's reasonable.

@@ -506,7 +481,8 @@ impl<'a, R: Read> serde::de::VariantVisitor for Deserializer<'a, R> {
{
let index: u32 = try!(serde::Deserialize::deserialize(self));
let mut deserializer = (index as usize).into_deserializer();
Ok(try!(serde::Deserialize::deserialize(&mut deserializer)))
let attempt: Result<V, serde::de::value::Error> = serde::Deserialize::deserialize(&mut deserializer);
Ok(try!(attempt))

This comment has been minimized.

@nox

nox Mar 4, 2016

Member

I guess this is needed for type inference to be happy? :(

This comment has been minimized.

@TyOverby

TyOverby Mar 4, 2016

Author Collaborator

yep :(

This comment has been minimized.

@nox

nox Mar 4, 2016

Member

You should be able to do:

Ok(try!(serde::Deserialize::deserialize::<Result<V, _>>(&mut deserializer)))

I'm not sure it's an improvement though.

@nox
Copy link
Member

nox commented Mar 4, 2016

Apart from these few remarks, LGTM!

@TyOverby TyOverby force-pushed the serde-0.7 branch from 08b6136 to 912aa2a Mar 4, 2016
@TyOverby
Copy link
Collaborator Author

TyOverby commented Mar 4, 2016

As soon as the lights go green I'll merge!

TyOverby added a commit that referenced this pull request Mar 4, 2016
Support serde 0.7
@TyOverby TyOverby merged commit 8829e66 into master Mar 4, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@TyOverby TyOverby deleted the serde-0.7 branch Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.