I have a function:
fn f(...) -> ???;
??? is a type like
String. On one platform this function can just return an
&str, because the string will be somewhere inside the parameters, but on other platforms, it’ll have to allocate an extra string. What would be the best return type?
String, and just use
to_ownedand the associated negligible performance hit.
- Something else.