Comment
Comment by duped
This is what the `AsRef` trait is great for
To be totally defensive, other library authors can write their APIs like
and now `s` is treated like any other &str. But even if library authors don't program defensively and use `s: &str` in the argument type, callers can always do this: