Skip to content

Conversation

@Lorak-mmk
Copy link
Collaborator

@Lorak-mmk Lorak-mmk commented Jul 3, 2025

Replaces: #1386

clippy::uninlined_format_args warns about format strings that have its variables listed after format string, instead of having it directly in curly braces.
Advantages of that? Shorter code that plays better with cargo fmt, and no need to jump with your eyes between string and values to understand the format.

There are a lot of changes, but they are fully mechanical, performed by clippy itself using cargo clippy --all-targets --fix --allow-dirty after I fixed first three occurrences myself.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

There are a lot of changes, but they are fully mechanical, performed by
clippy itself using `cargo clippy --all-targets --fix --allow-dirty`
after I fixed first three occurrences myself.
@Lorak-mmk Lorak-mmk requested review from Copilot, piodul and wprzytula July 3, 2025 09:31
@Lorak-mmk Lorak-mmk self-assigned this Jul 3, 2025
@Lorak-mmk Lorak-mmk added this to the 1.3.0 milestone Jul 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR applies the clippy::uninlined_format_args fix across the codebase by converting all format! and println! calls from numbered {} placeholders to inline Rust 1.58+ named formatting (e.g., "{}""{var}").

  • Replaces println!("Unique name: {}", name); with println!("Unique name: {name}");
  • Converts all format! usages in tests and source to use {var} inside the literal
  • Updates debug and display implementations to use inline formatting

Reviewed Changes

Copilot reviewed 87 out of 87 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scylla/tests/integration/utils.rs Updated println! to named interpolation
scylla/tests/integration/types/cql_value.rs Converted format! calls to inline {ks} usage
scylla/tests/integration/types/cql_types.rs Changed table DDL and query strings to named formatting
scylla/src/utils/test_utils.rs println! updated to use {name}
scylla/src/statement/prepared.rs ColumnSpec formatting switched to format!("col_{i}")
scylla/src/response/query_result.rs Infinite iterator formatting updated
scylla/src/policies/load_balancing/default.rs Test string literals switched to inline formatting
scylla/src/network/connection_pool.rs Debug impl updated for inline formatting
scylla/src/cluster/node.rs Error message formatting updated
scylla-cql/src/value.rs Display impl switched to {fl}, {u}, etc.
scylla-cql/src/utils/parse.rs Display impl for ParseErrorCause updated
examples/value_list.rs Example prints switched to named formatting
... ... many other files follow the same pattern

@github-actions
Copy link

github-actions bot commented Jul 3, 2025

cargo semver-checks found no API-breaking changes in this PR.
Checked commit: 1b40972

Copy link
Collaborator

@piodul piodul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, the lint has made a comeback - we had to deal with it in the past when it was enabled by default: #643. It was made non-default back again shortly afterwards.

Last time, my main concern was inlined format args didn't have good support in rust-analyzer. I checked and now they are properly supported, which is nice.

@Lorak-mmk
Copy link
Collaborator Author

Last time, my main concern was inlined format args didn't have good support in rust-analyzer. I checked and now they are properly supported, which is nice.

Maybe this is the reason this lint was removed (from defaults) before, and added again now?

@Lorak-mmk
Copy link
Collaborator Author

Looks like this: rust-lang/rust-clippy#14160

@Lorak-mmk Lorak-mmk merged commit 73b27c5 into scylladb:main Jul 3, 2025
12 checks passed
@piodul
Copy link
Collaborator

piodul commented Jul 3, 2025

Yeah, looks like it was not only my concern - in fact, I probably learned about the problem after reading the issue, and only then it became my main concern.

@wprzytula wprzytula mentioned this pull request Jul 6, 2025
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.

2 participants