about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-08-11 11:53:21 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2020-08-11 15:15:26 +0200
commitac194cafc124276d4614bf023ca7ea6e9be9c6ed (patch)
treeb95fb1e653d299773a5e2762dfc0c72890382200
parentc0a9d64818d7076b72fd6c3a9e6172eca659034b (diff)
downloadrust-ac194cafc124276d4614bf023ca7ea6e9be9c6ed.tar.gz
rust-ac194cafc124276d4614bf023ca7ea6e9be9c6ed.zip
map_clone: make lint adhere to lint message convention
-rw-r--r--clippy_lints/src/map_clone.rs12
-rw-r--r--tests/ui/map_clone.stderr24
2 files changed, 18 insertions, 18 deletions
diff --git a/clippy_lints/src/map_clone.rs b/clippy_lints/src/map_clone.rs
index 641e6a17043..1cd5b201292 100644
--- a/clippy_lints/src/map_clone.rs
+++ b/clippy_lints/src/map_clone.rs
@@ -111,8 +111,8 @@ fn lint_needless_cloning(cx: &LateContext<'_>, root: Span, receiver: Span) {
         cx,
         MAP_CLONE,
         root.trim_start(receiver).unwrap(),
-        "You are needlessly cloning iterator elements",
-        "Remove the `map` call",
+        "you are needlessly cloning iterator elements",
+        "remove the `map` call",
         String::new(),
         Applicability::MachineApplicable,
     )
@@ -125,8 +125,8 @@ fn lint(cx: &LateContext<'_>, replace: Span, root: Span, copied: bool) {
             cx,
             MAP_CLONE,
             replace,
-            "You are using an explicit closure for copying elements",
-            "Consider calling the dedicated `copied` method",
+            "you are using an explicit closure for copying elements",
+            "consider calling the dedicated `copied` method",
             format!(
                 "{}.copied()",
                 snippet_with_applicability(cx, root, "..", &mut applicability)
@@ -138,8 +138,8 @@ fn lint(cx: &LateContext<'_>, replace: Span, root: Span, copied: bool) {
             cx,
             MAP_CLONE,
             replace,
-            "You are using an explicit closure for cloning elements",
-            "Consider calling the dedicated `cloned` method",
+            "you are using an explicit closure for cloning elements",
+            "consider calling the dedicated `cloned` method",
             format!(
                 "{}.cloned()",
                 snippet_with_applicability(cx, root, "..", &mut applicability)
diff --git a/tests/ui/map_clone.stderr b/tests/ui/map_clone.stderr
index 9eec6928e8c..4f43cff5024 100644
--- a/tests/ui/map_clone.stderr
+++ b/tests/ui/map_clone.stderr
@@ -1,40 +1,40 @@
-error: You are using an explicit closure for copying elements
+error: you are using an explicit closure for copying elements
   --> $DIR/map_clone.rs:10:22
    |
 LL |     let _: Vec<i8> = vec![5_i8; 6].iter().map(|x| *x).collect();
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `vec![5_i8; 6].iter().copied()`
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `vec![5_i8; 6].iter().copied()`
    |
    = note: `-D clippy::map-clone` implied by `-D warnings`
 
-error: You are using an explicit closure for cloning elements
+error: you are using an explicit closure for cloning elements
   --> $DIR/map_clone.rs:11:26
    |
 LL |     let _: Vec<String> = vec![String::new()].iter().map(|x| x.clone()).collect();
-   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `cloned` method: `vec![String::new()].iter().cloned()`
+   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `vec![String::new()].iter().cloned()`
 
-error: You are using an explicit closure for copying elements
+error: you are using an explicit closure for copying elements
   --> $DIR/map_clone.rs:12:23
    |
 LL |     let _: Vec<u32> = vec![42, 43].iter().map(|&x| x).collect();
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `vec![42, 43].iter().copied()`
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `vec![42, 43].iter().copied()`
 
-error: You are using an explicit closure for copying elements
+error: you are using an explicit closure for copying elements
   --> $DIR/map_clone.rs:14:26
    |
 LL |     let _: Option<u64> = Some(&16).map(|b| *b);
-   |                          ^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `Some(&16).copied()`
+   |                          ^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&16).copied()`
 
-error: You are using an explicit closure for copying elements
+error: you are using an explicit closure for copying elements
   --> $DIR/map_clone.rs:15:25
    |
 LL |     let _: Option<u8> = Some(&1).map(|x| x.clone());
-   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `copied` method: `Some(&1).copied()`
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&1).copied()`
 
-error: You are needlessly cloning iterator elements
+error: you are needlessly cloning iterator elements
   --> $DIR/map_clone.rs:26:29
    |
 LL |     let _ = std::env::args().map(|v| v.clone());
-   |                             ^^^^^^^^^^^^^^^^^^^ help: Remove the `map` call
+   |                             ^^^^^^^^^^^^^^^^^^^ help: remove the `map` call
 
 error: aborting due to 6 previous errors