Skip to content

Allow Option<Id<T>> to use the null pointer optimization #2

Open
@SSheldon

Description

@SSheldon

Since Ids will never be null, the representation of Option<Id<T>> can take advantage of this to be the same size as an Id<T>.

Doing this requires the NonZero struct, which is being stabilized with rust-lang/rust#27730.

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