3 ms·
> So to me it's pointless, and I care more about knowing how many bytes a string takes and being able to index the string in O(1), or take pointers in the middl
by estebank 6y ago
> So to me it's pointless, and I care more about knowing how many bytes a string takes and being able to index the string in O(1), or take pointers in the middle of the string (useful when you are parsing some kind of structured data), and so on.
Which is why you can still sub-slice Strings[1]
> Literally nothing is stopping you from using `&[u8]` for 7-bit ASCII.
Not only that, there's first party support for literals that are that[2].
[1]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fe1fa17cd5bfbe5b7d1e4a162a8c106b https://play.rust-lang.org/?version=stable&mode=debug&editio...
[2]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=28b9b84ebf317f0e6bae4e00907239c3 https://play.rust-lang.org/?version=stable&mode=debug&editio...