&str
, String
, AsRef<str>
, or Into<String>
in Rust? I'm developing a public Rust library and I'm unsure how to handle function parameters that deal with strings. There seem to be multiple idiomatic options: - &str
- String
- impl AsRef<str>
- impl Into<String>
Each of these works in different cases, but I don't u...