about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-17 23:44:29 +0100
committerGitHub <noreply@github.com>2022-12-17 23:44:29 +0100
commit8fc1a72e563582aa4f132f73b30cf049055a03c2 (patch)
tree6c1fa06db9f0962263fa5741a07b672907247199 /compiler/rustc_parse/src/errors.rs
parentcf08eda0b379cdce4983f6fa344059b6bc23a64d (diff)
parentab2151cbf8270be61db8add6bfb1aea03230803f (diff)
downloadrust-8fc1a72e563582aa4f132f73b30cf049055a03c2.tar.gz
rust-8fc1a72e563582aa4f132f73b30cf049055a03c2.zip
Rollup merge of #105836 - evanj:fmt-doc-use-variables, r=Mark-Simulacrum
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