backtrace-rs icon indicating copy to clipboard operation
backtrace-rs copied to clipboard

Apply clippy::uninlined_format_args fixes

Open nyurik opened this issue 3 years ago • 4 comments

This is the result of running clippy::uninlined_format_args lint. Currently the lint is in pedantic, but there are plans/hopes to move it to style.

How can I add this specific lint to the current build/CI tools, or is this not possible? It would be ideal not to make the lint as the default style and then end up with hundreds of changes in an unrelated PR due to CI requirements.

Locally, I ran this to generate the changes. Not ideal because it has produced a number of compilation errors.

rustup run nightly cargo clippy --fix --no-deps --allow-dirty -- -A clippy::all -W clippy::uninlined_format_args

Note that the MSRV must be at least 1.58 (which introduced inline format args)

nyurik avatar Oct 08 '22 09:10 nyurik

Currently the lint is in pedantic, but there are plans/hopes to move it to style.

Where can I participate in this discussion of plans?

BurntSushi avatar Oct 08 '22 11:10 BurntSushi

thx for great feedback, agree, will fix!

nyurik avatar Jun 21 '23 21:06 nyurik

@workingjubilee I addressed your feedback, and added a few more similar inlinings.

To keep things cleaner, I think #539 should be merged first, possibly followed by #538

nyurik avatar Jul 02 '23 18:07 nyurik

Below is the size of a hello-world Rust program linked with libstd with backtrace.

Original binary size: 533976B Updated binary size: 530480B Difference: -3496B (-0.65%)

github-actions[bot] avatar Aug 19 '23 22:08 github-actions[bot]

@workingjubilee i rebased this PR to make sure it is up to date. Please review & merge unless there are some new issues. Thx!

nyurik avatar Jan 23 '24 01:01 nyurik

Code size changes for a hello-world Rust program linked with libstd with backtrace:

On platform windows-latest:

  • Original binary size: 140,800 B
  • Updated binary size: 138,752 B
  • Difference: -2,048 B (-1.45%)

github-actions[bot] avatar Mar 09 '24 06:03 github-actions[bot]