• SorteKanin@feddit.dkOP
    link
    fedilink
    arrow-up
    3
    ·
    5 days ago

    I would say depends but generally I would think not? I mean say you clone a string because you move it in one place and also need to borrow it in another place. So you clone to avoid the borrow checker erroring out on that. As far as I know, there will be two different strings created with separate allocations and all (but I could be wrong).