Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

tine, tiny note: it means Clone on write, not Copy, and it's String not Str.


Oops, typo. I've updated my comment accordingly, thanks.

Also, I didn't realize it was Clone-on-write. Interesting, and the documentation does confirm this. I say "interesting" because the actual operation involved is `to_owned()`, not `clone()`, seeing as how `clone()` on a `&str` just gives you the same `&str` back.


Yeah, conceptually it's closer to Clone even if it's not literally Clone.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: