4 ms·
> A string is the worst thing to return because it’s huge. Most people return () instead which is zero sized. I think what they're asking is "if you're returni
by masklinn 8y ago
> A string is the worst thing to return because it’s huge. Most people return () instead which is zero sized.
I think what they're asking is "if you're returning a Result<String, Err>" but you're making the Err an unhinabitated type (so can't ever have an error) why not just return a String in the first place?
- the_mitsuhiko 8y agoBecause there are generic APIs that return results as part of the contract. A good example is FromStr.
- deleted 8y ago[deleted]