diff options
| author | BO41 <botbob@disroot.org> | 2019-08-20 16:23:53 +0200 |
|---|---|---|
| committer | BO41 <botbob@disroot.org> | 2019-08-22 15:41:07 +0200 |
| commit | 3f56cb5d8b6ab217cc89c68f568b355bf6a35e28 (patch) | |
| tree | 1fd2bf32364d784f7b61b3c20c080d4c937286de | |
| parent | 43a2ba34e67a4bc9cdad409238e2c1fddc996f3c (diff) | |
| download | rust-3f56cb5d8b6ab217cc89c68f568b355bf6a35e28.tar.gz rust-3f56cb5d8b6ab217cc89c68f568b355bf6a35e28.zip | |
Add example to a perf lint
| -rw-r--r-- | clippy_lints/src/misc.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 362eaea3c1f..b9c05bb2bd3 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -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()`" |
