Skip to content

[Bug]: Roundtripping Option<UnitStruct> always results in None #99

@tekacs

Description

@tekacs

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

Given the type:

pub struct Test;

Some(Test), roundtripped through encode/decode comes back as None.
It appears that it's actually being encoded as None (F6 / null in CBOR).

Expected Behaviour

The value Some(Test) should roundtrip as Some(Test) and be encoded in a fashion which can be recovered.

Environment Information

ciborium = "0.2.1"
serde = { version = "1", features = ["derive"] }

Steps To Reproduce

There's a minimal reproduction of this issue here:

https://www.rustexplorer.com/b/3cig4b

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions