Unignore Serializer::serialize_tuple_struct example

This commit is contained in:
David Tolnay
2017-04-07 10:26:00 -07:00
parent 8d130123d9
commit fccb395168
+17 -6
View File
@@ -614,12 +614,23 @@ pub trait Serializer: Sized {
/// The `name` is the name of the tuple struct and the `len` is the number /// The `name` is the name of the tuple struct and the `len` is the number
/// of data fields that will be serialized. /// of data fields that will be serialized.
/// ///
/// ```rust,ignore /// ```rust
/// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; /// use serde::{Serialize, Serializer};
/// ts.serialize_field(&self.0)?; /// use serde::ser::SerializeTupleStruct;
/// ts.serialize_field(&self.1)?; ///
/// ts.serialize_field(&self.2)?; /// struct Rgb(u8, u8, u8);
/// ts.end() ///
/// impl Serialize for Rgb {
/// fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
/// 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, fn serialize_tuple_struct(self,
name: &'static str, name: &'static str,