3 ms·
> char is a primitive value that resides on the stack and CPU registers This is inaccurate. Vec<char> will store chars on the heap. & the concept of primitive
by __s 6y ago
> char is a primitive value that resides on the stack and CPU registers
This is inaccurate. Vec<char> will store chars on the heap. & the concept of primitive values exists in Java, whereas in Rust any struct you declare can exist on the stack (or in CPU registers if the optimizer decides to)
But yes, char is a 32 bit integer as opposed to String being a Vec<u8> under the wraps, & Vec<char> is preferable to Vec<Vec<u8>>