Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But there's no invalid u8 bit pattern.


But there is for Option<u8> which is the entirety of the u8s bits if the Option is None.


I'm still confused. You have a grand total of 257 possible combinations here:

- Some(Some(x)) for x in [0, 255]

- Some(None)

- None

No matter how you slice it, you can't fit them all into 8 bits, hence why it needs an extra byte.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: