Add example to a perf lint
This commit is contained in:
parent
43a2ba34e6
commit
3f56cb5d8b
@ -105,6 +105,12 @@
|
||||
/// # let y = String::from("foo");
|
||||
/// if x.to_owned() == y {}
|
||||
/// ```
|
||||
/// Could be written as
|
||||
/// ```rust
|
||||
/// # let x = "foo";
|
||||
/// # let y = String::from("foo");
|
||||
/// if x == y {}
|
||||
/// ```
|
||||
pub CMP_OWNED,
|
||||
perf,
|
||||
"creating owned instances for comparing with others, e.g., `x == \"foo\".to_string()`"
|
||||
|
Loading…
Reference in New Issue
Block a user