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

> I'm starting to wonder what I'm missing out by doing this.

It depends. In some cases, you aren't missing anything. In others, you may lose a bit of efficiency by doing some otherwise un-needed copying. Depending on what you're doing that may be irrelevant.

> Any tips for using the more abstract features, like Cow etc? I hit a problem with this today, where a lib used Cow<&str> instead of String, and the lifetime errors bubbled up into my code.

You can do the same thing as you do with &str by calling into_owned on the Cow, you'd get a String back.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: