Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sedatk
77 days ago
|
parent
|
context
|
favorite
| on:
Under the hood: Vec<T>
> Since a NonNull<T> can never be null, the compiler knows it can use the 0 address to represent the None variant when it sees an Option<NonNull<T>>
I didn't know this about Rust. That's awesome.
danhau
77 days ago
[–]
Same optimizations apply to the various NonZero types, IIRC.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
I didn't know this about Rust. That's awesome.