[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ-ks9=g9-bKoyh0++4f7CVQYth3Rb20FAd1-cgwXy8dYj27Dg@mail.gmail.com>
Date: Fri, 7 Feb 2025 14:01:35 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] rust: macros: improve panic messages
On Fri, Feb 7, 2025 at 1:12 PM Miguel Ojeda
<miguel.ojeda.sandonis@...il.com> wrote:
>
> On Fri, Feb 7, 2025 at 6:22 PM Tamir Duberstein <tamird@...il.com> wrote:
> >
> > Include unexpected input on parsing failures. This has the side effect
> > of avoiding a spurious rust-analyzer warning:
> >
> > Variable `None` should have snake_case name, e.g. `none`
>
> Hmm... That should be solved independently, but sure.
>
> In any case, how is this related to the second patch in the series?
> i.e. do you need both to solve the macOS issue?
No, it's not required - you're right to point that out. I'll send it
separately. Is it very inconvenient to consider the other patch on its
own?
> > + let Some(token) = it.next() else {
> > + break;
> > + };
> > + match token {
> > + TokenTree::Punct(punct) => assert_eq!(punct.as_char(), ','),
> > + token => panic!("Expected ',' or end of array, got {}", token),
>
> Do we want to shadow here?
I personally like this style because the shadow and shadowed are the
same variable and the presence of a binding in the match expression
hints to the reader that it's used somewhere in the body of the match
arm. Do you have another preference?
> Also, I think you could write `{token}`. Same above.
Good call. Will make it so.
> Could you please show how the new output would look like in the commit message?
Yes, I will include before and after output.
> Cheers,
> Miguel
Powered by blists - more mailing lists