rust-lang / backtrace-rs

Backtraces in Rust
https://docs.rs/backtrace
Other
537 stars 246 forks source link

Apply clippy::uninlined_format_args fixes #486

Closed nyurik closed 8 months ago

nyurik commented 2 years ago

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)

BurntSushi commented 2 years ago

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?

nyurik commented 1 year ago

thx for great feedback, agree, will fix!

nyurik commented 1 year ago

@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

github-actions[bot] commented 1 year ago

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%)

nyurik commented 9 months ago

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

github-actions[bot] commented 8 months ago

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

On platform windows-latest: