Skip to content

take_from_bytes_cobs not consuming trailing null bytes inserted by to_slice_cobs #50

@DusterTheFirst

Description

@DusterTheFirst

take_from_bytes_cobs returns two things on success. The de-serialized structure and any leftover buffer. When de-serializing using take_from_bytes_cobs it would make sense for the trailing null byte to be consumed by the de-serialization since it is somewhat part of the data. It also is unintuitive that the user will end up with a buffer with a single null byte after de-serializing cobs data.

My specific use case is as follows:
Calling postcard::to_slice_cobs on my data returns [2, 1, 0] and calling postcard::take_from_bytes_cobs returns (<my data>, &[0])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions