Re: [PATCH v2 3/5] rust: num: add `as_bool` method to `Bounded<_, 1>`

From: Gary Guo

Date: Wed Jan 21 2026 - 09:51:56 EST


On Wed Jan 21, 2026 at 7:23 AM GMT, Alexandre Courbot wrote:
> Single-bit numbers are typically treated as booleans. There is an
> `Into<bool>` implementation for those, but invoking it from contexts
> that lack type expectations is not always convenient.
>
> Add an `as_bool` method as a simpler shortcut.
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/num/bounded.rs | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)