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

Handle tuple deserialization in deserialize_any properly #124

Merged
merged 4 commits into from
Aug 7, 2018

Conversation

torkleyy
Copy link
Contributor

@torkleyy torkleyy commented Aug 5, 2018

Fixes #121

Needs some more tests before merging. I'm not happy about all the lookahead that this requires, but I don't see a better solution.

@torkleyy
Copy link
Contributor Author

torkleyy commented Aug 5, 2018

Okay, let's see if bors works now.

bors try

bors bot added a commit that referenced this pull request Aug 5, 2018
@bors
Copy link
Contributor

bors bot commented Aug 5, 2018

try

Build succeeded

@torkleyy
Copy link
Contributor Author

torkleyy commented Aug 5, 2018

Okay, now only one issue remains: The conversion from a serialized tuple to a Value loses the tuple information (it becomes a sequence). That's because Serde's data model doesn't differentiate between those two.

V: Visitor<'de>
{
// Create a working copy
let mut bytes = self.bytes.clone();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method doesn't mutate the actual byte stream even on success?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, but through calling self.deserialize_tuple / self.deserialize_struct. I need to create a working copy for lookahead first, the bytes do get consumed later.

@torkleyy
Copy link
Contributor Author

torkleyy commented Aug 7, 2018

Thank you for the review!
bors r+

bors bot added a commit that referenced this pull request Aug 7, 2018
124: Handle tuple deserialization in deserialize_any properly r=torkleyy a=torkleyy

Fixes #121 

Needs some more tests before merging. I'm not happy about all the lookahead that this requires, but I don't see a better solution.

Co-authored-by: Thomas Schaller <torkleyy@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 7, 2018

Build succeeded

@bors bors bot merged commit c521ff0 into ron-rs:master Aug 7, 2018
@torkleyy torkleyy deleted the val-tp branch August 7, 2018 15:49
@@ -1,6 +1,6 @@
[package]
name = "ron"
version = "0.3.0"
version = "0.4.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to make a release? I am hitting this exact issue right now 🤣

@torkleyy
Copy link
Contributor Author

Sure!

@torkleyy
Copy link
Contributor Author

I think I can just make it 0.3.1 though.

@torkleyy
Copy link
Contributor Author

Ah well, technically it could break something so I'll just go for 0.4.

@torkleyy
Copy link
Contributor Author

Done ;)

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

Successfully merging this pull request may close these issues.

3 participants