about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBO41 <botbob@disroot.org>2019-08-20 16:23:53 +0200
committerBO41 <botbob@disroot.org>2019-08-22 15:41:07 +0200
commit3f56cb5d8b6ab217cc89c68f568b355bf6a35e28 (patch)
tree1fd2bf32364d784f7b61b3c20c080d4c937286de
parent43a2ba34e67a4bc9cdad409238e2c1fddc996f3c (diff)
downloadrust-3f56cb5d8b6ab217cc89c68f568b355bf6a35e28.tar.gz
rust-3f56cb5d8b6ab217cc89c68f568b355bf6a35e28.zip
Add example to a perf lint
-rw-r--r--clippy_lints/src/misc.rs6
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()`"