Skip to content

Why not save u1 as a bool? #2

@veniamin-ilmer

Description

@veniamin-ilmer

This is more of a discussion/enhancement rather than an "issue". Reading through the code, I see u1 is saved in a u8.

I imagine Rust might be able to optimize a bool more effectively than a u8 in some situations. It would be interesting to see benchmarks over the effectiveness of bool vs u8 for u1.

I currently don't have a usecase for u1 however. Ordinarily when I want to store 1 bit, I would be using bool anyway.. I am not sure when it would be beneficial to use u1 over bool.

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