4 ms·
I confess to feel weird at the idea to need a copy to print something twice
by poulpy123 2y ago
I confess to feel weird at the idea to need a copy to print something twice
- itishappy 2y agoReferences avoid this: fn show(s: &String) { println!("s = {s}"); } fn main() { let s = String::from("hiya"); show(&s); show(&s); }
- deleted 2y ago[deleted]
- ycombinatrix 2y agoThat should feel weird because it is inefficient & unnecessary