yosh on Nostr: My favorite string type is probably `Cow<‘static, str>`, since it only allocates if ...
My favorite string type is probably `Cow<‘static, str>`, since it only allocates if it strictly needs to. And if you use `impl Into<Cow<‘static, str>>` as a bound, you can pass both string literals and allocated strings into functions without a problem.
My least favorite string type is probably `Cow<‘static, str>`. Because seeing something like `impl Into<Cow<‘static, str>>` in a function parameter is a *lot* to read, write, and understand. And it still misses a bunch of optimizations.
My least favorite string type is probably `Cow<‘static, str>`. Because seeing something like `impl Into<Cow<‘static, str>>` in a function parameter is a *lot* to read, write, and understand. And it still misses a bunch of optimizations.