Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd endianness to serializers and deserializers #155
Conversation
|
I'm not sure I understand. Is this working around a regression introduced by a change in the compiler? If so, is it really a good idea to work around it, rather than waiting for a fix in the compiler?... |
| @@ -152,7 +153,7 @@ impl<T> IpcSender<T> where T: Serialize { | |||
| let os_ipc_shared_memory_regions; | |||
| let os_ipc_channels; | |||
| { | |||
| let mut serializer = bincode::Serializer::new(&mut bytes); | |||
| let mut serializer = bincode::Serializer::<_, LittleEndian>::new(&mut bytes); | |||
This comment has been minimized.
This comment has been minimized.
antrik
Feb 27, 2017
Contributor
Shouldn't that rather be NativeEndian?
(Which is apparently hard-aliased to LittleEndian anyway, for whatever reason -- but still it seems a more obvious choice conceptually?...)
This comment has been minimized.
This comment has been minimized.
|
This is the bincode crate publishing servo/bincode@5cdf2a2 as a non-semver-compatible version update, presumably (servo/bincode@eebd6a9). |
|
Actually, if using |
|
@jdm well, I don't quite understand the interaction between |
|
(For the record, even if unintentional, strictly speaking this is actually semver-compatible, since semver explicitly states that there are no API guarantees whatsoever for pre-releases... But then again, the Cargo interpretation of semver doesn't match the actual standard anyway.) |
It is indeed a
Agreed.
Right. The addition of the endianness generics seems to be the cause. |
Ensure that the endianness used is the native endianness of the system.
|
Actually, this workaround will work only with the breaking API change; so the patch at least has to update the In other words, this can probably be only addressed in a sane way in |
dlrobertson commentedFeb 26, 2017
Enforce endianness in the creation of our serializers and deserializers
in the ipc module.
Resolves: #154