Skip to content

Commit 8134ee2

Browse files
committed
renamed emit_nil to emit_unit
1 parent a0e7b6b commit 8134ee2

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Diff for: src/librustc/ty/query/on_disk_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ impl<'enc, 'a, 'tcx, E> Encoder for CacheEncoder<'enc, 'a, 'tcx, E>
10201020
{
10211021
type Error = E::Error;
10221022

1023-
fn emit_nil(&mut self) -> Result<(), Self::Error> {
1023+
fn emit_unit(&mut self) -> Result<(), Self::Error> {
10241024
Ok(())
10251025
}
10261026

Diff for: src/librustc_metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ macro_rules! encoder_methods {
7575
impl<'a, 'tcx> Encoder for EncodeContext<'a, 'tcx> {
7676
type Error = <opaque::Encoder as Encoder>::Error;
7777

78-
fn emit_nil(&mut self) -> Result<(), Self::Error> {
78+
fn emit_unit(&mut self) -> Result<(), Self::Error> {
7979
Ok(())
8080
}
8181

Diff for: src/libserialize/json.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ macro_rules! emit_enquoted_if_mapkey {
490490
impl<'a> ::Encoder for Encoder<'a> {
491491
type Error = EncoderError;
492492

493-
fn emit_nil(&mut self) -> EncodeResult {
493+
fn emit_unit(&mut self) -> EncodeResult {
494494
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
495495
write!(self.writer, "null")?;
496496
Ok(())
@@ -648,7 +648,7 @@ impl<'a> ::Encoder for Encoder<'a> {
648648
}
649649
fn emit_option_none(&mut self) -> EncodeResult {
650650
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
651-
self.emit_nil()
651+
self.emit_unit()
652652
}
653653
fn emit_option_some<F>(&mut self, f: F) -> EncodeResult where
654654
F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
@@ -740,7 +740,7 @@ impl<'a> PrettyEncoder<'a> {
740740
impl<'a> ::Encoder for PrettyEncoder<'a> {
741741
type Error = EncoderError;
742742

743-
fn emit_nil(&mut self) -> EncodeResult {
743+
fn emit_unit(&mut self) -> EncodeResult {
744744
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
745745
write!(self.writer, "null")?;
746746
Ok(())
@@ -923,7 +923,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> {
923923
}
924924
fn emit_option_none(&mut self) -> EncodeResult {
925925
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
926-
self.emit_nil()
926+
self.emit_unit()
927927
}
928928
fn emit_option_some<F>(&mut self, f: F) -> EncodeResult where
929929
F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
@@ -1016,7 +1016,7 @@ impl Encodable for Json {
10161016
Json::Boolean(v) => v.encode(e),
10171017
Json::Array(ref v) => v.encode(e),
10181018
Json::Object(ref v) => v.encode(e),
1019-
Json::Null => e.emit_nil(),
1019+
Json::Null => e.emit_unit(),
10201020
}
10211021
}
10221022
}

Diff for: src/libserialize/opaque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl serialize::Encoder for Encoder {
5555
type Error = !;
5656

5757
#[inline]
58-
fn emit_nil(&mut self) -> EncodeResult {
58+
fn emit_unit(&mut self) -> EncodeResult {
5959
Ok(())
6060
}
6161

Diff for: src/libserialize/serialize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub trait Encoder {
2525
type Error;
2626

2727
// Primitive types:
28-
fn emit_nil(&mut self) -> Result<(), Self::Error>;
28+
fn emit_unit(&mut self) -> Result<(), Self::Error>;
2929
fn emit_usize(&mut self, v: usize) -> Result<(), Self::Error>;
3030
fn emit_u128(&mut self, v: u128) -> Result<(), Self::Error>;
3131
fn emit_u64(&mut self, v: u64) -> Result<(), Self::Error>;
@@ -537,7 +537,7 @@ impl Decodable for char {
537537

538538
impl Encodable for () {
539539
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
540-
s.emit_nil()
540+
s.emit_unit()
541541
}
542542
}
543543

0 commit comments

Comments
 (0)