4 ms·
Isn’t the point that in this case it cannot ever error because the string is static?
by Kaze404 4y ago
Isn’t the point that in this case it cannot ever error because the string is static?
- sanderjd 4y agoYes, but if you use the `?` operator, as the comment I replied to suggested, then you have to return a `Result`, which the caller has to unwrap themselves or otherwise handle. Except the caller doesn't have this context about how it can't be an error because it's a static string. Propagating the (impossible) error up the call chain is the worst of all worlds in a case like this.