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

Yes, Rust will not automatically turn a value into a reference for you. A reference is the semantic you desire. If you have a value, you’re gonna have to toss & on it. That’s the idiomatic way to do this, not to pass a value and clone it.

&str is Copy, String is not.



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

Search: