Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Option serializing is fundamentally broken #312

Open
Zoxc opened this issue Aug 24, 2022 · 1 comment
Open

Option serializing is fundamentally broken #312

Zoxc opened this issue Aug 24, 2022 · 1 comment

Comments

@Zoxc
Copy link

Zoxc commented Aug 24, 2022

It doesn't serialize the enumerator.

fn serialize_some<T: ?Sized + serde::Serialize>(self, v: &T) -> Result<(), Self::Error> {
    v.serialize(self)
}

It would probably make sense to change this to encode None as a 0-sized array and Some as a 1-sized array.

@kornelski
Copy link
Collaborator

Yes, it tries to be clever by using null for None, but that can't express nesting.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants