parent
10b2083a6d
commit
fa683ac656
4 changed files with 5 additions and 5 deletions
|
@ -298,7 +298,7 @@ macro_rules! implement_ty_decoder {
|
|||
type Error = String;
|
||||
|
||||
__impl_decoder_methods! {
|
||||
read_unit -> ();
|
||||
read_nil -> ();
|
||||
|
||||
read_u128 -> u128;
|
||||
read_u64 -> u64;
|
||||
|
|
|
@ -2128,7 +2128,7 @@ macro_rules! read_primitive {
|
|||
impl ::Decoder for Decoder {
|
||||
type Error = DecoderError;
|
||||
|
||||
fn read_unit(&mut self) -> DecodeResult<()> {
|
||||
fn read_nil(&mut self) -> DecodeResult<()> {
|
||||
expect!(self.pop(), Null)
|
||||
}
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
|
|||
type Error = String;
|
||||
|
||||
#[inline]
|
||||
fn read_unit(&mut self) -> Result<(), Self::Error> {
|
||||
fn read_nil(&mut self) -> Result<(), Self::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ pub trait Decoder {
|
|||
type Error;
|
||||
|
||||
// Primitive types:
|
||||
fn read_unit(&mut self) -> Result<(), Self::Error>;
|
||||
fn read_nil(&mut self) -> Result<(), Self::Error>;
|
||||
fn read_usize(&mut self) -> Result<usize, Self::Error>;
|
||||
fn read_u128(&mut self) -> Result<u128, Self::Error>;
|
||||
fn read_u64(&mut self) -> Result<u64, Self::Error>;
|
||||
|
@ -543,7 +543,7 @@ impl Encodable for () {
|
|||
|
||||
impl Decodable for () {
|
||||
fn decode<D: Decoder>(d: &mut D) -> Result<(), D::Error> {
|
||||
d.read_unit()
|
||||
d.read_nil()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue