about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorEvan Jones <ej@evanjones.ca>2022-12-17 13:43:08 -0500
committerEvan Jones <ej@evanjones.ca>2022-12-17 13:43:08 -0500
commitab2151cbf8270be61db8add6bfb1aea03230803f (patch)
treeaf54afd2be12f3a02e71ad7a8783ecfe8221c143 /compiler/rustc_parse/src/errors.rs
parent65c53c3bb6190319e210c94164b05a17997073f2 (diff)
downloadrust-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