▲ | adgjlsfhk1 4 days ago | |||||||
How is that UTF8 specific? | ||||||||
▲ | ubitaco 4 days ago | parent | next [-] | |||||||
It's slightly buried in the readme on Github: > how can we store a 24 byte long string, inline? Don't we also need to store the length somewhere? > To do this, we utilize the fact that the last byte of our string could only ever have a value in the range [0, 192). We know this because all strings in Rust are valid UTF-8, and the only valid byte pattern for the last byte of a UTF-8 character (and thus the possible last byte of a string) is 0b0XXXXXXX aka [0, 128) or 0b10XXXXXX aka [128, 192) | ||||||||
| ||||||||
▲ | 4 days ago | parent | prev [-] | |||||||
[deleted] |