Fix uninline format clippy violations#667
Conversation
Pull Request Test Coverage Report for Build 14666415050Details
💛 - Coveralls |
0b0247a to
c9850f1
Compare
|
I have combed through the diff a couple times. Nothing stood out. But please review carefully. |
payjoin-cli/tests/e2e.rs
Outdated
| let receiver_rpchost = format!("http://{}/wallet/receiver", bitcoind.params.rpc_socket); | ||
| let sender_rpchost = format!("http://{}/wallet/sender", bitcoind.params.rpc_socket); | ||
| let receiver_rpchost = | ||
| format!("http://{host}/wallet/receiver", host = bitcoind.params.rpc_socket); |
There was a problem hiding this comment.
that's neat, didn't know you could do that
benalleng
left a comment
There was a problem hiding this comment.
TACK couldn't find any egregious misses or vars put in the wrong order in the formatting string.
Personally though, I hate it and wish that we didn't have to put everything inside of these formatters like this.
DanGould
left a comment
There was a problem hiding this comment.
I like the change in general but
- let's not make semantic changes in the same commit as one where it can be verified by a reviewer using an automated tool and (i.e. keep debug
:?semantics to use Debug impl, not Display where applicable) - please don't make opinionated non-semantic style changes in the same commit. changing
res = response.status()might feel right but it makes verifying the change fromclippy --fixone that can't be automatically verified by comparing a diff after running a command. This is the same idea as keeping semantic changes from changes to whitespace or lints.
payjoin-cli/src/app/config.rs
Outdated
| "Multiple version flags specified. Please use only one of: {flags}", | ||
| flags = Self::VERSION_FLAGS | ||
| .iter() | ||
| .map(|(flag, _)| format!("--{}", flag)) | ||
| .map(|(flag, _)| format!("--{flag}")) |
There was a problem hiding this comment.
I'd rather we just Self::VERSION_FLAGS here and droped the additional var
Edit: I realize this change doesn't make sense, flags is a complex expression. But clippy doesn't complain about it so we can just leave it
There was a problem hiding this comment.
Removed the flag variable. Clippy is ok with non-inline vars if you are using a expression
c9850f1 to
a0840cf
Compare
If we all hate it we do have the option of skipping this rule. Personally I think its a bit more readable. |
|
Split changes into two commits: Automatically generated and manually generated fixes (left out any semantic changes) |
This change was automatically applied using `cargo clippy --fix && cargo fmt`. It addresses the newly introduced `uninlined_format_args` lint, which requires variables to be inlined directly within format strings as of Rust 1.88.0 nightly. [Clippy lint reference](https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args)
The `uninlined_format_args` lint was added in the latest Rust 1.88 nightly. This commit includes the manual changes required to address it. Specifically, the ones that `cargo clippy --fix` could not automatically resolve. [Clippy lint reference](https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args)
a0840cf to
b42eee4
Compare
|
I am ok with the change if everyone else thinks its overall more readable |
DanGould
left a comment
There was a problem hiding this comment.
Thanks for going through the tedious rigamarole. Setting up review like this is gonna let us move faster on a regular basis as the changes arise. I think that's a long lever so I hope you agree it is worth the short-term tedium.
- I can confirm cafd68b is equivalent to running
cargo +1.88.0 clippy --fixandcargo +1.88.0 fmt
ACK b42eee4
Agreed. Automated changes should be reproducable and verifiable. |
This change was automatically generated via
cargo clippy --fix. In the lastest nightly release 1.88.0 vars need to be inline in a format string.https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args