Comment by kragen
Comment by kragen 2 days ago
That's semantically okay, but giving &str such a short name creates a dangerous temptation to use it for things such as filenames, stdio, and command-line arguments, where that process of conversion introduces errors into code that would otherwise work reliably for any non-null-containing string, as it does in Go. If it were called something like ValidatedUnicodeTextSlice it would probably be fine.
I'd agree if it was &[bytes] or whatever. But &[u8] isn't that much different from &str.