When to use &str instead of String::new and vice versa ?
Thank you.
When to use &str instead of String::new and vice versa ?
Thank you.
Have you read chapter 4 of the book? It goes into this question in detail Understanding Ownership - The Rust Programming Language