2 Detect when a variable is not inlined in a format string,
3 and suggests to inline it.
6 Non-inlined code is slightly more difficult to read and understand,
7 as it requires arguments to be matched against the format string.
8 The inlined syntax, where allowed, is simpler.
13 format!("{v:?}", v = var);
14 format!("{0} {0}", var);
15 format!("{0:1$}", var, width);
16 format!("{:.*}", prec, var);
22 format!("{var} {var}");
23 format!("{var:width$}");
24 format!("{var:.prec$}");
29 There may be a false positive if the format string is expanded from certain proc macros:
32 println!(indoc!("{}"), var);
35 If a format string contains a numbered argument that cannot be inlined
36 nothing will be suggested, e.g. `println!("{0}={1}", var, 1+2)`.