Skip to content

Conversation

Eijebong
Copy link
Contributor

No description provided.

@highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @metajack (or someone else) soon.

@jdm
Copy link
Member

jdm commented May 29, 2017

Why are we reverting to an earlier version of bincode?

@Eijebong
Copy link
Contributor Author

Unless I misunderstood something, bincode did 1.0-alpha => 0.8

Might be me though

Copy link
Contributor

@antrik antrik left a comment

Choose a reason for hiding this comment

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

Sorry for the silly question: does the Deserialize bounds change actually break the public interface of ipc-channel, or only make it more powerful?...

src/ipc.rs Outdated
let mut data = &*self.data;
let mut deserializer = bincode::Deserializer::new(&mut data, bincode::Infinite);
let data = bincode::read_types::SliceReader::new(&self.data[..]);
let mut deserializer = bincode::Deserializer::new(data, bincode::Infinite);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the binding better be called something else than data after this change?... (reader perhaps? Or maybe data_reader?...)

@antrik
Copy link
Contributor

antrik commented May 31, 2017

@Eijebong note that while it's true that 0.8 is the most recent release,0.7 and 1.0.0-alpha7 have been released at the same time... Looks to me like they are supposed to be separate branches being developed in parallel?

I don't know how to decide which one is more appropriate for us to use, though.

@metajack
Copy link
Collaborator

pinging @nox who is the upgrade master for advice

@nox
Copy link
Contributor

nox commented May 31, 2017

Pinging @gankro too who is the last who has touched bincode stuff. What's the current state of art over there? Why is there 0.8 and still alpha 1.0 versions?

@Eijebong
Copy link
Contributor Author

ping @TyOverby, @gankro told us to ping you concerning bincode's versioning.

@TyOverby
Copy link

@Eijebong: bincode 0.8.0 is indeed the most recent release


#[derive(Debug)]
pub struct IpcReceiver<T> where T: Deserialize + Serialize {
pub struct IpcReceiver<T> where T: for<'de> Deserialize<'de> + Serialize {

Choose a reason for hiding this comment

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

I'd check with @dtolnay, but I'm pretty sure that since you can't taking advantage of zero-copy parsing, you could replace all of these lifetime bounds with Deserialize<'static>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would this really make a difference ?

Copy link

Choose a reason for hiding this comment

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

Deserialize<'static> is never what you want. for<'de> Deserialize<'de> or DeserializeOwned is correct. See https://serde.rs/lifetimes.html#trait-bounds.

Choose a reason for hiding this comment

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

@dtolnay: Ah yep, it was DeserializeOwned that I was thinking of.

@Eijebong: It would clean up all of the type signatures. That's about it though.

src/ipc.rs Outdated
let mut data = &*self.data;
let mut deserializer = bincode::Deserializer::new(&mut data, bincode::Infinite);
let reader = bincode::read_types::SliceReader::new(&self.data[..]);
let mut deserializer = bincode::Deserializer::new(reader, bincode::Infinite);

Choose a reason for hiding this comment

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

Is there any reason that you aren't just using bincode::deserialize here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably because I didn't know it existed. I'll try with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it seems to be working.

@jdm
Copy link
Member

jdm commented Jun 15, 2017

@bors-servo: r+

@bors-servo
Copy link
Contributor

📌 Commit 7d0c49b has been approved by jdm

@bors-servo
Copy link
Contributor

⌛ Testing commit 7d0c49b with merge 36e7f5f...

bors-servo pushed a commit that referenced this pull request Jun 15, 2017
Bump serde to 1.0, bincode to 0.8 and bump version
@bors-servo
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: jdm
Pushing 36e7f5f to master...

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

Successfully merging this pull request may close these issues.

9 participants