rs-versions icon indicating copy to clipboard operation
rs-versions copied to clipboard

Bug with parser::unsigned

Open DatPat opened this issue 4 months ago • 1 comments

pub(crate) fn unsigned(i: &str) -> IResult<&str, u32> { map_res(alt((tag("0"), digit1)), |s: &str| s.parse::()).parse(i) }

parses strings such as 01 02 etc correctly in the sense that it returns the right number, however, it does not advance the string by the actual number of consumed letters. Instead it only consumed the 0 but leaves the rest (1 or 2).

DatPat avatar Aug 05 '25 10:08 DatPat

Thanks, I will double-check this.

fosskers avatar Aug 06 '25 06:08 fosskers