Unignore Serializer::serialize_newtype_struct example

This commit is contained in:
David Tolnay 2017-04-07 10:02:11 -07:00
parent 753c711cd7
commit 43d49f54be
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -452,8 +452,18 @@ pub trait Serializer: Sized {
/// wrappers around the data they contain. A reasonable implementation would /// wrappers around the data they contain. A reasonable implementation would
/// be to forward to `value.serialize(self)`. /// be to forward to `value.serialize(self)`.
/// ///
/// ```rust,ignore /// ```rust
/// # use serde::{Serialize, Serializer};
/// #
/// struct Millimeters(u8);
///
/// impl Serialize for Millimeters {
/// fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
/// where S: Serializer
/// {
/// serializer.serialize_newtype_struct("Millimeters", &self.0) /// serializer.serialize_newtype_struct("Millimeters", &self.0)
/// }
/// }
/// ``` /// ```
fn serialize_newtype_struct<T: ?Sized + Serialize>(self, fn serialize_newtype_struct<T: ?Sized + Serialize>(self,
name: &'static str, name: &'static str,