From bc8197c884e7a5dae25b6aedb02eac98145bee92 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 31 Jan 2017 10:42:51 +0100 Subject: Update serde to 0.9.3 and use serde::ser::Impossible --- src/ser/void.rs | 122 -------------------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 src/ser/void.rs (limited to 'src/ser/void.rs') diff --git a/src/ser/void.rs b/src/ser/void.rs deleted file mode 100644 index 4765bb7..0000000 --- a/src/ser/void.rs +++ /dev/null @@ -1,122 +0,0 @@ -use ser::Error; -use serde::ser; -use std::marker::PhantomData; -use void; - -pub struct VoidSerializer { - void: void::Void, - _marker: PhantomData, -} - -impl ser::SerializeSeq for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_element(&mut self, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} - -impl ser::SerializeTuple for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_element(&mut self, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} - -impl ser::SerializeTupleStruct for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_field(&mut self, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} - -impl ser::SerializeTupleVariant for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_field(&mut self, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} - -impl ser::SerializeMap for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_key(&mut self, - _key: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn serialize_value(&mut self, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} - -impl ser::SerializeStruct for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_field(&mut self, - _key: &'static str, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} - -impl ser::SerializeStructVariant for VoidSerializer { - type Ok = Ok; - type Error = Error; - - fn serialize_field(&mut self, - _key: &'static str, - _value: &T) - -> Result<(), Error> { - void::unreachable(self.void) - } - - fn end(self) -> Result { - void::unreachable(self.void) - } -} -- cgit v1.2.3