Add example to a perf lint

This commit is contained in:
BO41 2019-08-20 16:23:53 +02:00
parent 43a2ba34e6
commit 3f56cb5d8b

View File

@ -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()`"