2 Checks for usage of `.repeat(1)` and suggest the following method for each types.
3 - `.to_string()` for `str`
4 - `.clone()` for `String`
5 - `.to_vec()` for `slice`
7 The lint will evaluate constant expressions and values as arguments of `.repeat(..)` and emit a message if
8 they are equivalent to `1`. (Related discussion in [rust-clippy#7306](https://github.com/rust-lang/rust-clippy/issues/7306))
11 For example, `String.repeat(1)` is equivalent to `.clone()`. If cloning
12 the string is the intention behind this, `clone()` should be used.
17 let x = String::from("hello world").repeat(1);
23 let x = String::from("hello world").clone();