4 ms·
C also has &str and &String, but they're "char* that crashes if you free() it" and "char* that leaks if you don't free() it". Ownership is hard to learn, and i
by pornel 3y ago
C also has &str and &String, but they're "char* that crashes if you free() it" and "char* that leaks if you don't free() it".
Ownership is hard to learn, and it is a barrier to learning Rust. However, don't confuse it with C++. Rust has two+ string types on purpose, not because of carrying 1970's legacy.