This script works, but what's the difference between ?
fn main() {
let v = vec!["hello", "world"];
fn say(word: &str) {
println!("say: {}", word);
}
let word = v[0];
say(word); // <----- this
say(&word); // <----- and this
println!("word is in: {}", word);
}
And what's the best practices for String and &str?
Thank you!