All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Miguel Ojeda" <ojeda@kernel.org>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Petr Pavlu" <petr.pavlu@suse.com>,
	"Daniel Gomez" <da.gomez@kernel.org>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>
Cc: "Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org,
	"Aaron Tomlin" <atomlin@atomlin.com>,
	linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 2/2] rust: macros: simplify `format!` arguments
Date: Tue, 31 Mar 2026 22:07:34 +0100	[thread overview]
Message-ID: <DHH9VXDSLIPE.10JBKMPZIPCUB@garyguo.net> (raw)
In-Reply-To: <20260331205849.498295-2-ojeda@kernel.org>

On Tue Mar 31, 2026 at 9:58 PM BST, Miguel Ojeda wrote:
> Clippy in Rust 1.88.0 (only) reported [1] up to the previous commit:
> 
>     warning: variables can be used directly in the `format!` string
>        --> rust/macros/module.rs:112:23
>         |
>     112 |         let content = format!("{param}:{content}", param = param, content = content);
>         |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>         |
>         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
>         = note: `-W clippy::uninlined-format-args` implied by `-W clippy::all`
>         = help: to override `-W clippy::all` add `#[allow(clippy::uninlined_format_args)]`
>     help: change this to
>         |
>     112 -         let content = format!("{param}:{content}", param = param, content = content);
>     112 +         let content = format!("{param}:{content}");
> 
> The reason it only triggers in that version is that the lint was moved
> from `pedantic` to `style` in Rust 1.88.0 and then back to `pedantic`
> in Rust 1.89.0 [2][3].
> 
> In this case, the suggestion is fair and a pure simplification, thus
> just apply it.
> 
> In addition, do the same for another place in the file that Clippy does
> not report because it is multi-line.
> 
> Link: https://lore.kernel.org/rust-for-linux/CANiq72=drAtf3y_DZ-2o4jb6Az9J3Yj4QYwWnbRui4sm4AJD3Q@mail.gmail.com/ [1]
> Link: https://github.com/rust-lang/rust-clippy/pull/15287 [2]
> Link: https://github.com/rust-lang/rust-clippy/issues/15151 [3]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Gary Guo <gary@garyguo.net>

> ---
>  rust/macros/module.rs | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)


  reply	other threads:[~2026-03-31 21:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 20:58 [PATCH 1/2] kbuild: rust: allow `clippy::uninlined_format_args` Miguel Ojeda
2026-03-31 20:58 ` [PATCH 2/2] rust: macros: simplify `format!` arguments Miguel Ojeda
2026-03-31 21:07   ` Gary Guo [this message]
2026-04-03  4:53   ` Miguel Ojeda
2026-04-03 15:52     ` Sami Tolvanen
2026-04-03 21:23       ` Miguel Ojeda
2026-03-31 21:07 ` [PATCH 1/2] kbuild: rust: allow `clippy::uninlined_format_args` Gary Guo
2026-03-31 21:14   ` Miguel Ojeda
2026-03-31 21:43     ` Gary Guo
2026-03-31 21:53       ` Miguel Ojeda
2026-04-01 15:36         ` Gary Guo
2026-04-03 10:06 ` Miguel Ojeda
2026-04-03 10:24 ` Tamir Duberstein
2026-04-03 13:07   ` Miguel Ojeda
2026-04-09 16:18     ` Tamir Duberstein
2026-04-09 17:06       ` Gary Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DHH9VXDSLIPE.10JBKMPZIPCUB@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=atomlin@atomlin.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=da.gomez@kernel.org \
    --cc=dakr@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.