Skip to content

Commit 3d7188d

Browse files
authored
Add uninlined_format_args example for {:?} (#15228)
Before this, you had to guess how to fix a `{:?}` formatting argument. I have happened to guess `{:?var}` in the past, got frustrated, and disabled the lint. This additional example would have saved me a bit of trouble. changelog: [`uninlined_format_args`]: added an example of how to fix a `{:?}` parameter.
2 parents e2270bb + 6b6f35e commit 3d7188d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_lints/src/format_args.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ declare_clippy_lint! {
128128
/// # let width = 1;
129129
/// # let prec = 2;
130130
/// format!("{}", var);
131+
/// format!("{:?}", var);
131132
/// format!("{v:?}", v = var);
132133
/// format!("{0} {0}", var);
133134
/// format!("{0:1$}", var, width);
@@ -140,6 +141,7 @@ declare_clippy_lint! {
140141
/// # let prec = 2;
141142
/// format!("{var}");
142143
/// format!("{var:?}");
144+
/// format!("{var:?}");
143145
/// format!("{var} {var}");
144146
/// format!("{var:width$}");
145147
/// format!("{var:.prec$}");

0 commit comments

Comments
 (0)