Skip to content

Commit

Permalink
Add example to a perf lint
Browse files Browse the repository at this point in the history
  • Loading branch information
BO41 committed Aug 22, 2019
1 parent 43a2ba3 commit 3f56cb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clippy_lints/src/misc.rs
Expand Up @@ -105,6 +105,12 @@ declare_clippy_lint! {
/// # 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()`"
Expand Down

0 comments on commit 3f56cb5

Please sign in to comment.