From fccb3951689bc99b52f3f595413a365e2cabf417 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 7 Apr 2017 10:26:00 -0700 Subject: [PATCH] Unignore Serializer::serialize_tuple_struct example --- serde/src/ser/mod.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index 524c7514..dbe728e1 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -614,12 +614,23 @@ pub trait Serializer: Sized { /// The `name` is the name of the tuple struct and the `len` is the number /// of data fields that will be serialized. /// - /// ```rust,ignore - /// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; - /// ts.serialize_field(&self.0)?; - /// ts.serialize_field(&self.1)?; - /// ts.serialize_field(&self.2)?; - /// ts.end() + /// ```rust + /// use serde::{Serialize, Serializer}; + /// use serde::ser::SerializeTupleStruct; + /// + /// struct Rgb(u8, u8, u8); + /// + /// impl Serialize for Rgb { + /// fn serialize(&self, serializer: S) -> Result + /// where S: Serializer + /// { + /// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; + /// ts.serialize_field(&self.0)?; + /// ts.serialize_field(&self.1)?; + /// ts.serialize_field(&self.2)?; + /// ts.end() + /// } + /// } /// ``` fn serialize_tuple_struct(self, name: &'static str,