Rust for Linux List
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Alexandre Courbot" <acourbot@nvidia.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Christian Brauner" <brauner@kernel.org>,
	"Carlos Llamas" <cmllamas@google.com>,
	"Alice Ryhl" <aliceryhl@google.com>
Cc: <linux-kernel@vger.kernel.org>, <rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH] binder: use irrefutable let patterns
Date: Sun, 20 Sep 2026 17:03:04 +0100	[thread overview]
Message-ID: <DLK9R14M9X05.A1RS5NSZO3EU@garyguo.net> (raw)
In-Reply-To: <20260921-binder_let-v1-1-0cfc4c535544@nvidia.com>

On Sun Sep 20, 2026 at 4:49 PM BST, Alexandre Courbot wrote:
> Replace matches on infallible results with irrefutable let patterns,
> which are available since Rust 1.82.
> 
> This removes boilerplate for handling impossible error variants.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>

FWIW, this pattern can be served by `into_ok()` which is in the process of being
stabilized right now. This is also available in 1.85 unstably, however the
methods expect real never type (!) and does not work with `Infallible`.

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

> ---
>  drivers/android/binder/freeze.rs       |  6 ++----
>  drivers/android/binder/node/wrapper.rs |  6 ++----
>  drivers/android/binder/process.rs      | 17 ++++-------------
>  3 files changed, 8 insertions(+), 21 deletions(-)


  reply	other threads:[~2026-09-20 16:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 15:49 [PATCH] binder: use irrefutable let patterns Alexandre Courbot
2026-09-20 16:03 ` Gary Guo [this message]
2026-09-21 23:38 ` Carlos Llamas
2026-09-22 20:18 ` Alice Ryhl

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=DLK9R14M9X05.A1RS5NSZO3EU@garyguo.net \
    --to=gary@garyguo.net \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=arve@android.com \
    --cc=brauner@kernel.org \
    --cc=cmllamas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tkjos@android.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox