Skip to content

Commit

Permalink
renamed read_nil to read_unit
Browse files Browse the repository at this point in the history
  • Loading branch information
kenta7777 committed Sep 10, 2018
1 parent d02a5ff commit 37d0600
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/librustc/ty/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ macro_rules! implement_ty_decoder {
type Error = String;

__impl_decoder_methods! {
read_nil -> ();
read_unit -> ();

read_u128 -> u128;
read_u64 -> u64;
Expand Down
2 changes: 1 addition & 1 deletion src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ macro_rules! read_primitive {
impl ::Decoder for Decoder {
type Error = DecoderError;

fn read_nil(&mut self) -> DecodeResult<()> {
fn read_unit(&mut self) -> DecodeResult<()> {
expect!(self.pop(), Null)
}

Expand Down
2 changes: 1 addition & 1 deletion src/libserialize/opaque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl<'a> serialize::Decoder for Decoder<'a> {
type Error = String;

#[inline]
fn read_nil(&mut self) -> Result<(), Self::Error> {
fn read_unit(&mut self) -> Result<(), Self::Error> {
Ok(())
}

Expand Down
4 changes: 2 additions & 2 deletions src/libserialize/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub trait Decoder {
type Error;

// Primitive types:
fn read_nil(&mut self) -> Result<(), Self::Error>;
fn read_unit(&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>;
Expand Down Expand Up @@ -543,7 +543,7 @@ impl Encodable for () {

impl Decodable for () {
fn decode<D: Decoder>(d: &mut D) -> Result<(), D::Error> {
d.read_nil()
d.read_unit()
}
}

Expand Down

0 comments on commit 37d0600

Please sign in to comment.