Skip to content

Commit 3f56cb5

Browse files
author
BO41
committed
Add example to a perf lint
1 parent 43a2ba3 commit 3f56cb5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/misc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ declare_clippy_lint! {
105105
/// # let y = String::from("foo");
106106
/// if x.to_owned() == y {}
107107
/// ```
108+
/// Could be written as
109+
/// ```rust
110+
/// # let x = "foo";
111+
/// # let y = String::from("foo");
112+
/// if x == y {}
113+
/// ```
108114
pub CMP_OWNED,
109115
perf,
110116
"creating owned instances for comparing with others, e.g., `x == \"foo\".to_string()`"

0 commit comments

Comments
 (0)