Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup format arguments #2650

Merged
merged 1 commit into from Jul 31, 2023
Merged

Cleanup format arguments #2650

merged 1 commit into from Jul 31, 2023

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Jul 25, 2023

Inlined format args make code more readable, and code more compact. Also, in some cases when format is called with a reference instead of a value (i.e. internally it becomes double reference). These cases cause ~6% performance delay due to dynamic dispatch that Rust cannot currently handle properly.

I ran this clippy command to fix most cases, and then cleaned up a few trailing commas and uncaught edge cases.

cargo clippy --bins --examples  --benches --tests --lib --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args

Inlined format args make code more readable, and code more compact.

I ran this clippy command to fix most cases, and then cleaned up a few trailing commas and uncaught edge cases.

```
cargo clippy --bins --examples  --benches --tests --lib --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args
```
@abonander abonander merged commit a824e84 into launchbadge:main Jul 31, 2023
53 checks passed
@abonander
Copy link
Collaborator

Much appreciated, thanks!

@nyurik nyurik deleted the inline_fmt branch July 31, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants