Skip to content

Conversation

@ethanfrey
Copy link

This allows structs defining newtypes to deserialize properly. eg:

    #[derive(Deserialize, Clone, Debug, PartialEq)]
    pub struct Address(pub String);

    #[derive(Deserialize, Clone, Debug, PartialEq)]
    pub struct NewtypeDemo {
        pub address: Address,
    }

@ethanfrey ethanfrey merged commit 8a4e4a2 into master Dec 20, 2019
@ethanfrey ethanfrey deleted the add-newtype-string-support branch December 20, 2019 14:01

/// Unsupported. We can’t parse newtypes because we don’t know the underlying type.
fn deserialize_newtype_struct<V>(self, _name: &'static str, _visitor: V) -> Result<V::Value>
fn deserialize_newtype_struct<V>(self, _name: &'static str, visitor: V) -> Result<V::Value>
Copy link
Member

@webmaster128 webmaster128 Dec 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment still up-to-date?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. i am bad about updating comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants