Re: From<bool> and Bounded's invariant for signed N = 1

"Alexandre Courbot" <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Fri Aug 14, 2026 at 4:52 AM JST, Younes Akhouayri wrote:
> Thank you both for the feedback. Yes, I can send a patch.
>
> Just to confirm the intended scope: excluding signed integers entirely would also remove valid conversions such as Bounded::<i8, 2>::from(true), since signed Bounded values with N >= 2 can represent both 0 and 1.
>
> Would you prefer the simpler unsigned-only restriction, or should the patch preserve signed conversions for N >= 2?

If you can preserve the latter without complicating the code too much,
then I'd say that should be preferred yes.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.