Auto merge of #5926 - giraffate:improve_lint_message_in_to_string_in_display, r=yaahc

Improve lint message in `to_string_in_display`

This is a follow-up of https://github.com/rust-lang/rust-clippy/pull/5831.

changelog: none
This commit is contained in:
bors 2020-08-22 04:51:38 +00:00
commit b57ef14290
3 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@
/// ```
pub TO_STRING_IN_DISPLAY,
correctness,
"to_string method used while implementing Display trait"
"`to_string` method used while implementing `Display` trait"
}
#[derive(Default)]
@ -80,7 +80,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
cx,
TO_STRING_IN_DISPLAY,
expr.span,
"Using to_string in fmt::Display implementation might lead to infinite recursion",
"using `to_string` in `fmt::Display` implementation might lead to infinite recursion",
);
}
}

View File

@ -2183,7 +2183,7 @@
Lint {
name: "to_string_in_display",
group: "correctness",
desc: "to_string method used while implementing Display trait",
desc: "`to_string` method used while implementing `Display` trait",
deprecation: None,
module: "to_string_in_display",
},

View File

@ -1,4 +1,4 @@
error: Using to_string in fmt::Display implementation might lead to infinite recursion
error: using `to_string` in `fmt::Display` implementation might lead to infinite recursion
--> $DIR/to_string_in_display.rs:25:25
|
LL | write!(f, "{}", self.to_string())