diff --git a/src/de/mod.rs b/src/de/mod.rs index e1179ea98..eff2546d8 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -42,23 +42,27 @@ macro_rules! impl_deserialize_literal { }; } -impl<'de, R: BincodeRead<'de>, O: Options> Deserializer { +impl<'de, IR: Read, O: Options> Deserializer, O> { /// Creates a new Deserializer with a given `Read`er and options. - pub fn with_reader(r: IR, options: O) -> Deserializer, O> { + pub fn with_reader(r: IR, options: O) -> Self { Deserializer { reader: IoReader::new(r), options, } } +} +impl<'de, O: Options> Deserializer, O> { /// Creates a new Deserializer that will read from the given slice. - pub fn from_slice(slice: &'de [u8], options: O) -> Deserializer, O> { + pub fn from_slice(slice: &'de [u8], options: O) -> Self { Deserializer { reader: SliceReader::new(slice), options, } } +} +impl<'de, R: BincodeRead<'de>, O: Options> Deserializer { /// Creates a new Deserializer with the given `BincodeRead`er pub fn with_bincode_read(r: R, options: O) -> Deserializer { Deserializer { reader: r, options }