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/part.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/ser/part.rs') diff --git a/src/ser/part.rs b/src/ser/part.rs index e720314..42653c0 100644 --- a/src/ser/part.rs +++ b/src/ser/part.rs @@ -1,7 +1,6 @@ use dtoa; use itoa; use ser::Error; -use ser::void::VoidSerializer; use serde::ser; use std::str; @@ -37,13 +36,13 @@ pub trait Sink: Sized { impl ser::Serializer for PartSerializer { type Ok = S::Ok; type Error = Error; - type SerializeSeq = VoidSerializer; - type SerializeTuple = VoidSerializer; - type SerializeTupleStruct = VoidSerializer; - type SerializeTupleVariant = VoidSerializer; - type SerializeMap = VoidSerializer; - type SerializeStruct = VoidSerializer; - type SerializeStructVariant = VoidSerializer; + type SerializeSeq = ser::Impossible; + type SerializeTuple = ser::Impossible; + type SerializeTupleStruct = ser::Impossible; + type SerializeTupleVariant = ser::Impossible; + type SerializeMap = ser::Impossible; + type SerializeStruct = ser::Impossible; + type SerializeStructVariant = ser::Impossible; fn serialize_bool(self, v: bool) -> Result { self.sink.serialize_static_str(if v { "true" } else { "false" }) @@ -210,7 +209,7 @@ impl ser::Serializer for PartSerializer { impl PartSerializer { fn serialize_integer(self, value: I) -> Result - where I: itoa::Integer + where I: itoa::Integer, { let mut buf = [b'\0'; 20]; let len = itoa::write(&mut buf[..], value).unwrap(); @@ -219,7 +218,7 @@ impl PartSerializer { } fn serialize_floating(self, value: F) -> Result - where F: dtoa::Floating + where F: dtoa::Floating, { let mut buf = [b'\0'; 24]; let len = dtoa::write(&mut buf[..], value).unwrap(); -- cgit v1.2.3