map_clone: make lint adhere to lint message convention

This commit is contained in:
Matthias Krüger 2020-08-11 11:53:21 +02:00
parent c0a9d64818
commit ac194cafc1
2 changed files with 18 additions and 18 deletions

View file

@ -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)