Re: [PATCH] binder: use irrefutable let patterns

From: Gary Guo

Date: Sun Sep 20 2026 - 12:03:18 EST


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@xxxxxxxxxx>

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@xxxxxxxxxxx>

> ---
> 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(-)