Alexhuszagh / rust-lexical

Fast numeric to- and from-string conversion routines.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parse_partial ignoring minus sign in presence of trailing characters

antislava opened this issue · comments

Rather counterintuitively, while e.g. lexical_core::parse_partial::<i8>(b"-3") produces (-3, 2) as expected, in presence of trailing non-digit characters this function seems to just ignore the minus sign: lexical_core::parse_partial::<i8>(b"-3a") returns (3, 2), i.e. a positive number!
Is this intended behavior? (Couldn't find any clarification in the code/documentation.)

This is definitely a bug, thanks for reporting. I'll debug this quickly and draft a new release.

Confirmed this reproduces both with the compact and default features.

Fixed as of the v0.8.6 release, which has been published on crates.io.