Skip to content

Commit b57ef14

Browse files
committed
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 rust-lang/rust-clippy#5831. changelog: none
2 parents aa3b04f + 902b282 commit b57ef14

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clippy_lints/src/to_string_in_display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ declare_clippy_lint! {
3939
/// ```
4040
pub TO_STRING_IN_DISPLAY,
4141
correctness,
42-
"to_string method used while implementing Display trait"
42+
"`to_string` method used while implementing `Display` trait"
4343
}
4444

4545
#[derive(Default)]
@@ -80,7 +80,7 @@ impl LateLintPass<'_> for ToStringInDisplay {
8080
cx,
8181
TO_STRING_IN_DISPLAY,
8282
expr.span,
83-
"Using to_string in fmt::Display implementation might lead to infinite recursion",
83+
"using `to_string` in `fmt::Display` implementation might lead to infinite recursion",
8484
);
8585
}
8686
}

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
21832183
Lint {
21842184
name: "to_string_in_display",
21852185
group: "correctness",
2186-
desc: "to_string method used while implementing Display trait",
2186+
desc: "`to_string` method used while implementing `Display` trait",
21872187
deprecation: None,
21882188
module: "to_string_in_display",
21892189
},

tests/ui/to_string_in_display.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Using to_string in fmt::Display implementation might lead to infinite recursion
1+
error: using `to_string` in `fmt::Display` implementation might lead to infinite recursion
22
--> $DIR/to_string_in_display.rs:25:25
33
|
44
LL | write!(f, "{}", self.to_string())

0 commit comments

Comments
 (0)