poulpy123 2 days ago

I confess to feel weird at the idea to need a copy to print something twice

2
itishappy 2 days ago

References avoid this:

    fn show(s: &String) {
        println!("s = {s}");
    }
    
    fn main() {
        let s = String::from("hiya");
        show(&s);
        show(&s);
    }

ycombinatrix 2 days ago

That should feel weird because it is inefficient & unnecessary