]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/mut_reference.rs
Give more corrected code examples in doc
[rust.git] / clippy_lints / src / mut_reference.rs
index e5680482e5bfba5251f8151c5c869f83b2163670..58a8e1a1064ae7603f46bce495a4a76c70afaff7 100644 (file)
@@ -6,7 +6,7 @@
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 
 declare_clippy_lint! {
-    /// **What it does:** Detects giving a mutable reference to a function that only
+    /// **What it does:** Detects passing a mutable reference to a function that only
     /// requires an immutable reference.
     ///
     /// **Why is this bad?** The immutable reference rules out all other references
     ///
     /// **Example:**
     /// ```ignore
+    /// // Bad
     /// my_vec.push(&mut value)
+    ///
+    /// // Good
+    /// my_vec.push(&value)
     /// ```
     pub UNNECESSARY_MUT_PASSED,
     style,