diff options
| author | Evan Jones <ej@evanjones.ca> | 2022-12-17 13:43:08 -0500 |
|---|---|---|
| committer | Evan Jones <ej@evanjones.ca> | 2022-12-17 13:43:08 -0500 |
| commit | ab2151cbf8270be61db8add6bfb1aea03230803f (patch) | |
| tree | af54afd2be12f3a02e71ad7a8783ecfe8221c143 /compiler/rustc_parse/src/errors.rs | |
| parent | 65c53c3bb6190319e210c94164b05a17997073f2 (diff) | |
| download | rust-ab2151cbf8270be61db8add6bfb1aea03230803f.tar.gz rust-ab2151cbf8270be61db8add6bfb1aea03230803f.zip | |
std::fmt: Use args directly in example code
The lint "clippy::uninlined_format_args" recommends inline
variables in format strings. Fix two places in the docs that do
not do this. I noticed this because I copy/pasted one example in
to my project, then noticed this lint error. This fixes:
error: variables can be used directly in the `format!` string
--> src/main.rs:30:22
|
30 | let string = format!("{:.*}", decimals, magnitude);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: variables can be used directly in the `format!` string
--> src/main.rs:39:2
|
39 | write!(&mut io::stdout(), "{}", args).unwrap();
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
