Re: [PATCH v9 1/3] rust: str: add radix prefixed integer parsing functions

From: Andreas Hindborg
Date: Mon Mar 31 2025 - 09:34:51 EST


"Miguel Ojeda" <miguel.ojeda.sandonis@xxxxxxxxx> writes:

> On Fri, Mar 21, 2025 at 10:18 AM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>>
>> Add the trait `ParseInt` for parsing string representations of integers
>> where the string representations are optionally prefixed by a radix
>> specifier. Implement the trait for the primitive integer types.
>>
>> Tested-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
>> Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
>> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
>
> I had applied the following comments in v8 when I originally took it
> before discovering the UB -- since this patch may finally go through
> modules (or not), Andreas asked me to put them here:
>
> [ Added integer type suffixes to `assert!`s for consistency with the
> others. Changed links to docs.kernel.org. Applied Markdown and
> intra-doc links where possible. Changed to `///` for `mod` docs.
> Slightly reworded comment. Pluralized section name. Hid
> `use`s. Removed `#[expect]` for the `rusttest` target. - Miguel ]
>
> Attached range diff of what I did.
>
> I hope that helps!

Thanks Miguel!

I will add the diff to the next spin.


Best regards,
Andreas Hindborg