mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Delete Decoder::read_unit
This commit is contained in:
@@ -2418,8 +2418,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
|
||||
}
|
||||
|
||||
impl<D: Decoder> rustc_serialize::Decodable<D> for AttrId {
|
||||
fn decode(d: &mut D) -> AttrId {
|
||||
d.read_unit();
|
||||
fn decode(_: &mut D) -> AttrId {
|
||||
crate::attr::mk_attr_id()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
|
||||
|
||||
impl<D: serialize::Decoder> serialize::Decodable<D> for PredecessorCache {
|
||||
#[inline]
|
||||
fn decode(d: &mut D) -> Self {
|
||||
let () = d.read_unit();
|
||||
fn decode(_: &mut D) -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,8 +465,6 @@ mod __ty_decoder_impl {
|
||||
|
||||
impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {
|
||||
$crate::__impl_decoder_methods! {
|
||||
read_unit -> ();
|
||||
|
||||
read_u128 -> u128;
|
||||
read_u64 -> u64;
|
||||
read_u32 -> u32;
|
||||
|
||||
@@ -555,11 +555,6 @@ macro_rules! read_leb128 {
|
||||
}
|
||||
|
||||
impl<'a> serialize::Decoder for Decoder<'a> {
|
||||
#[inline]
|
||||
fn read_unit(&mut self) -> () {
|
||||
()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn read_u128(&mut self) -> u128 {
|
||||
read_leb128!(self, read_u128_leb128)
|
||||
|
||||
@@ -181,7 +181,6 @@ fn emit_map_elt_val<F>(&mut self, f: F) -> Result<(), Self::Error>
|
||||
// concise.
|
||||
pub trait Decoder {
|
||||
// Primitive types:
|
||||
fn read_unit(&mut self) -> ();
|
||||
fn read_usize(&mut self) -> usize;
|
||||
fn read_u128(&mut self) -> u128;
|
||||
fn read_u64(&mut self) -> u64;
|
||||
@@ -324,9 +323,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
|
||||
}
|
||||
|
||||
impl<D: Decoder> Decodable<D> for () {
|
||||
fn decode(d: &mut D) -> () {
|
||||
d.read_unit()
|
||||
}
|
||||
fn decode(_: &mut D) -> () {}
|
||||
}
|
||||
|
||||
impl<S: Encoder, T> Encodable<S> for PhantomData<T> {
|
||||
@@ -336,8 +333,7 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
|
||||
}
|
||||
|
||||
impl<D: Decoder, T> Decodable<D> for PhantomData<T> {
|
||||
fn decode(d: &mut D) -> PhantomData<T> {
|
||||
d.read_unit();
|
||||
fn decode(_: &mut D) -> PhantomData<T> {
|
||||
PhantomData
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user