You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I was writing unit tests to ensure leading and trailing digit separators fail to parse in my program, I noticed a leading separator for floats returns a different error code than the other 3 cases. Instead of InvalidDigit, it returns EmptyMantissa. For the given input _12.34, the mantissa isn't actually empty, but (I assume) the parser never actually gets to parsing it because of the invalid leading separator. While this is a relatively minor issue (the number fails to parse either way), I believe returning InvalidDigit is more accurate and consistent, and thus more useful to users.
This addressed #96 and #97, fixing the lack of processing with
consecutive digit separators by enhancing the internal logic, adds logic
for internal and first digit separators to simplify logic and improve
performance, fix unittests, and also make it so the errors are
consistent by adding checks when formatting is enabled to ensure the
correct logic is used.
Closes#96Closes#97
This addressed #96 and #97, fixing the lack of processing with
consecutive digit separators by enhancing the internal logic, adds logic
for internal and first digit separators to simplify logic and improve
performance, fix unittests, and also make it so the errors are
consistent by adding checks when formatting is enabled to ensure the
correct logic is used.
Closes#96Closes#97
This addressed #96 and #97, fixing the lack of processing with
consecutive digit separators by enhancing the internal logic, adds logic
for internal and first digit separators to simplify logic and improve
performance, fix unittests, and also make it so the errors are
consistent by adding checks when formatting is enabled to ensure the
correct logic is used.
Closes#96Closes#97
Description
While I was writing unit tests to ensure leading and trailing digit separators fail to parse in my program, I noticed a leading separator for floats returns a different error code than the other 3 cases. Instead of
InvalidDigit
, it returnsEmptyMantissa
. For the given input_12.34
, the mantissa isn't actually empty, but (I assume) the parser never actually gets to parsing it because of the invalid leading separator. While this is a relatively minor issue (the number fails to parse either way), I believe returningInvalidDigit
is more accurate and consistent, and thus more useful to users.Prerequisites
rustc 1.68.0 (2c8cc3432 2023-03-06)
lexical-util v0.8.5
lexical-parse-integer v0.8.6
lexical-parse-float v0.8.5
lexical-core v0.8.5
lexical v6.1.1
Test case
The text was updated successfully, but these errors were encountered: