4 ms·
References avoid this: fn show(s: &String) { println!("s = {s}"); } fn main() { let s = String::from("hiya"); show(&s)
by itishappy 1y ago
References avoid this:
fn show(s: &String) {
println!("s = {s}");
}
fn main() {
let s = String::from("hiya");
show(&s);
show(&s);
}
- deleted 1y ago[deleted]