write_literal: Fix index of the remaining positional arguments by koka831 · Pull...
source link: https://github.com/rust-lang/rust-clippy/pull/11576
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
write_literal: Fix index of the remaining positional arguments #11576
Conversation
Contributor
- fixes cargo clippy --fix broken for positional arguments #10128
clippy --fix
replaces multiple warnings at once
e.g.)writeln!(v, "{0} {1}", "hello", "world"); // before: `writeln!(v, "hello {1}", "world");` // now: `writeln!(v, "hello world");`
changelog: [print_literal
], [write_literal
]: Now handles positional argument properly
Collaborator
r? @llogiq (rustbot has picked a reviewer for you, use r? to override) |
added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label
Contributor
Thanks, this looks good to me. I wonder whether we can also inline other literals beside str. For example the last example could well just write the "2", "3" and "4" literals as part of the format string. Anyway, @bors r+ |
Contributor
Author
Found that I'm not sure should we handle this (at least it can be relaxed by checking |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No reviews
None yet
No milestone
Successfully merging this pull request may close these issues.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK