Open
Description
There are a few different ways to convert from a &str
to a String
:
fn main() {
let _: String = "hello".to_owned();
let _: String = "hello".to_string();
let _: String = "hello".into();
let _: String = String::from("hello");
let _: String = format!("hello");
}
Without going into a discussion about which is the best (this lint has been deprecated), I think a lint to ensure the same one is used throughout a crate would be interesting.
This could be done either through configuration, or by keeping stats on which is used and then emit warning for the non majority one.
I can work on it, but wanted to have a general point of view before. What do you think ?