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 support for serde #43
Conversation
|
Wow! This will take me a while to read through, but it looks great! For example fn proxy_encoded_size<T: ...>(obj: &T) -> usize {
let ser_size = bincode::encoded_size(obj);
let serde_size = bincode::serialized_size(obj);
assert_eq(ser_size, serde_size);
return ser_size;
}I noticed that you already did that for the I might hold off on reading the rest of the code until I can build and run it myself. At the very least I'll get a refresher on Serde tonight. |
|
I am worried about how both of the implementations will be exposed though.
While they should be interchangeable, I think it'll be confusing to library users. |
pcwalton
commented
Aug 4, 2015
|
@TyOverby Ping. Servo really wants this. Is there a way I can help get this landed? |
|
I won't be able to merge this until serde hits 0.5.0 on crates.io, but I will review the code later tonight. It would be great if using serde also sidestepped #41! |
|
@erickt: I downloaded your patch and wired it up the path for Serde to your github repo so I could check it with 0.5.0, but there are a set of errors that indicate that serde can't be used with rust-1.0. I thought this was not the case?
|
| { | ||
| let len = match visitor.len() { | ||
| Some(len) => len, | ||
| None => panic!("do not know how to serialize a sequence with no length"), |
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| #[inline] | ||
| fn visit_u8<V>(&mut self, mut visitor: V) -> DeserializeResult<V::Value> |
This comment has been minimized.
This comment has been minimized.
pcwalton
commented
Aug 7, 2015
|
@erickt Ping. If you don't have time for this, would you prefer that I pick up the patch and push it through? |
|
@pcwalton: Just finally released 0.5.0 and updated this PR to build with it! |
|
Ok, I got it building with stable (testing requires nightly, but that's acceptable). There's a few changes that I'd like to make though, so I'll take this PR from here. |
|
Yay merged! |
erickt commentedJul 30, 2015
This is an initial PR that adds support for the yet-to-be-released serde version 0.5.0, so please don't merge this in until that lands. I wanted to submit it to get your input on the design and if you see if there are any gaps in the implementation.