diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-17 23:44:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-17 23:44:29 +0100 |
| commit | 8fc1a72e563582aa4f132f73b30cf049055a03c2 (patch) | |
| tree | 6c1fa06db9f0962263fa5741a07b672907247199 /compiler/rustc_parse/src/errors.rs | |
| parent | cf08eda0b379cdce4983f6fa344059b6bc23a64d (diff) | |
| parent | ab2151cbf8270be61db8add6bfb1aea03230803f (diff) | |
| download | rust-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
