Re: [PATCH v13 1/6] rust: str: add radix prefixed integer parsing functions

2025-06-19 Thread Andreas Hindborg
"Benno Lossin" writes: > On Thu Jun 19, 2025 at 1:12 PM CEST, Andreas Hindborg wrote: >> I'm having a difficult time parsing. Are you suggesting that we guard >> against implementations of `TryInto` that misbehave? > > Let me try a different explanation: > > The safety requirement for implementin

Re: [PATCH v13 1/6] rust: str: add radix prefixed integer parsing functions

2025-06-19 Thread Benno Lossin
On Thu Jun 19, 2025 at 1:12 PM CEST, Andreas Hindborg wrote: > I'm having a difficult time parsing. Are you suggesting that we guard > against implementations of `TryInto` that misbehave? Let me try a different explanation: The safety requirement for implementing the `FromStrRadix`: /// The

Re: [PATCH v13 1/6] rust: str: add radix prefixed integer parsing functions

2025-06-19 Thread Andreas Hindborg
"Benno Lossin" writes: > On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: >> +pub trait ParseInt: private::FromStrRadix + TryFrom { >> +/// Parse a string according to the description in [`Self`]. >> +fn from_str(src: &BStr) -> Result { >> +match src.deref() { >> +

Re: [PATCH v13 1/6] rust: str: add radix prefixed integer parsing functions

2025-06-18 Thread Benno Lossin
On Thu Jun 12, 2025 at 3:40 PM CEST, Andreas Hindborg wrote: > +pub trait ParseInt: private::FromStrRadix + TryFrom { > +/// Parse a string according to the description in [`Self`]. > +fn from_str(src: &BStr) -> Result { > +match src.deref() { > +[b'-', rest @ ..] => { >