Hacker News new | ask | show | jobs
by jbhn 462 days ago
Please do Strings next. Effective Rust isn't useful at guiding to a good default.

The technical arguments for one or the other option are available in a bunch of places, but no good guidance on an idiomatic default.

2 comments

Can you give an example of a situation where you’re not sure what string type to use?
I think Library APIs are a good example. I've found myself in the situation where I do not care about the string representation (or can convert in a few places if necessary), but need to provide an interface for others that is as frictionless as possible. My instinct there was to be generic and use From/To traits, but it never felt quite right.
Sure. I'll add it to my bucket list.