/// x += ", World";
/// x.push_str(", World");
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub STRING_ADD_ASSIGN,
pedantic,
"using `x = x + ..` where x is a `String` instead of `push_str()`"
/// let x = "Hello".to_owned();
/// x + ", World";
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub STRING_ADD,
restriction,
"using `x + ..` where x is a `String` instead of `push_str()`"
/// // Good
/// let bs = b"a byte string";
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub STRING_LIT_AS_BYTES,
nursery,
"calling `as_bytes` on a string literal instead of using a byte string literal"
/// ```rust,should_panic
/// &"Ölkanne"[1..];
/// ```
+ #[clippy::version = "1.58.0"]
pub STRING_SLICE,
restriction,
"slicing a string"
/// ```rust
/// let _ = &"Hello World!"[6..11];
/// ```
+ #[clippy::version = "1.50.0"]
pub STRING_FROM_UTF8_AS_BYTES,
complexity,
"casting string slices to byte slices and back"
/// // example code which does not raise clippy warning
/// let _ = "str".to_owned();
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub STR_TO_STRING,
restriction,
"using `to_string()` on a `&str`, which should be `to_owned()`"
/// let msg = String::from("Hello World");
/// let _ = msg.clone();
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub STRING_TO_STRING,
restriction,
"using `to_string()` on a `String`, which should be `clone()`"