about summary refs log tree commit diff
path: root/clippy_lints/src/format.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-02 12:11:28 +0000
committerbors <bors@rust-lang.org>2020-06-02 12:11:28 +0000
commit5cb9ef390aea2a1adaae4b9836bb7a3a75c47f25 (patch)
tree3264f79738b35896cde8fb12ed376fee02a4fad5 /clippy_lints/src/format.rs
parentf760d77bdb2bff46f284500f77ecc697dd8507c5 (diff)
parent137a3b4d3242cfe331f8f9b87c51ac0c431fe160 (diff)
Auto merge of #5664 - ThibsG:GiveCorrectedCode, r=flip1995
Give corrected code

This PR adds corrected code for doc examples.

I did this in several commits to facilitate review.
Don't hesitate to tell me if I forgot some.
Also, sometimes I felt it was not necessary to give corrected code, but I maybe wrong.

fixes: #4829

changelog: Improve documentation examples across multiple lints.
Diffstat (limited to 'clippy_lints/src/format.rs')
-rw-r--r--clippy_lints/src/format.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/clippy_lints/src/format.rs b/clippy_lints/src/format.rs
index 5b092526ce4..1530538aa7d 100644
--- a/clippy_lints/src/format.rs
+++ b/clippy_lints/src/format.rs
@@ -25,9 +25,13 @@ declare_clippy_lint! {
     ///
     /// **Examples:**
     /// ```rust
+    ///
+    /// // Bad
     /// # let foo = "foo";
-    /// format!("foo");
     /// format!("{}", foo);
+    ///
+    /// // Good
+    /// format!("foo");
     /// ```
     pub USELESS_FORMAT,
     complexity,