about summary refs log tree commit diff
path: root/compiler/rustc_serialize/src/serialize.rs
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-06-04 18:32:00 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2022-06-03 17:02:14 +0000
commit7381ea019c47282985baab8752d27aca0a432023 (patch)
tree024faffc04f6c026f37e670f7cf7f26cf8b4c68c /compiler/rustc_serialize/src/serialize.rs
parent22e8d5f80e58574a13f0623bef14015f424e8a7a (diff)
downloadrust-7381ea019c47282985baab8752d27aca0a432023.tar.gz
rust-7381ea019c47282985baab8752d27aca0a432023.zip
Remove emit_unit
It doesn't do anything for all encoders
Diffstat (limited to 'compiler/rustc_serialize/src/serialize.rs')
-rw-r--r--compiler/rustc_serialize/src/serialize.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs
index 8c12d250f0f..817a0c9dcb1 100644
--- a/compiler/rustc_serialize/src/serialize.rs
+++ b/compiler/rustc_serialize/src/serialize.rs
@@ -15,7 +15,6 @@ pub trait Encoder {
     type Error;
 
     // Primitive types:
-    fn emit_unit(&mut self) -> Result<(), Self::Error>;
     fn emit_usize(&mut self, v: usize) -> Result<(), Self::Error>;
     fn emit_u128(&mut self, v: u128) -> Result<(), Self::Error>;
     fn emit_u64(&mut self, v: u64) -> Result<(), Self::Error>;
@@ -203,8 +202,8 @@ impl<D: Decoder> Decodable<D> for String {
 }
 
 impl<S: Encoder> Encodable<S> for () {
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }
 
@@ -213,8 +212,8 @@ impl<D: Decoder> Decodable<D> for () {
 }
 
 impl<S: Encoder, T> Encodable<S> for PhantomData<T> {
-    fn encode(&self, s: &mut S) -> Result<(), S::Error> {
-        s.emit_unit()
+    fn encode(&self, _s: &mut S) -> Result<(), S::Error> {
+        Ok(())
     }
 }