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 upRemove rustc serialize support #95
Conversation
| #[cfg(feature = "rustc-serialize")] | ||
| pub mod rustc_serialize; | ||
| #[cfg(feature = "serde")] | ||
| pub mod refbox; | ||
| pub mod serde; |
This comment has been minimized.
This comment has been minimized.
dtolnay
Jan 31, 2017
Collaborator
Let's make this a private module and pub use serde::*. We no longer need the namespacing.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
My thoughts on the public API after browsing https://docs.rs/bincode/1.0.0-alpha1/bincode/:
|
Considering how close these enums are, I think this is totally reasonable.
I guess if people are prefixing (e.g.
Could you go more into detail here? I'm not really sure what it is that you're warning about. |
|
In regards to what @dtolnay is talking about. functions like |
Sure! Accepting a ?Sized type parameter for io::Read and io::Write means that it will work with &mut io::Read and &mut io::Write trait objects which are dynamically sized. use std::fs::File;
use std::io::Read;
fn main() {
let mut data = File::open("important.bin").unwrap();
let trait_object: &mut Read = &mut data;
deserialize_from(trait_object); // requires ?Sized
}
fn deserialize_from<R>(_: &mut R) where R: Read {}And accepting a ?Sized type parameter for &T means that it can work with dynamically sized implementations of Serialize, which includes str and [T] among others. fn main() {
serialize("&str"); // requires ?Sized
}
trait Serialize {}
impl Serialize for str {}
fn serialize<T>(_: &T) where T: Serialize {} |
TyOverby commentedJan 31, 2017
No description provided.