Skip to content

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

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

Open
SSheldon opened this issue Nov 7, 2015 · 0 comments
Open

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

SSheldon opened this issue Nov 7, 2015 · 0 comments

Comments

@SSheldon
Copy link
Owner

SSheldon commented Nov 7, 2015

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.

# 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

1 participant