-
Notifications
You must be signed in to change notification settings - Fork 139
refactor(strconv): parse_double #2744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 1292Details
💛 - Coveralls |
/// Parse the number from the string, returning the number and the length of the parsed string. | ||
fn parse_number(s : StringView) -> (Number, Int)? { | ||
let mut s = s | ||
fn parse_number(s : StringView) -> Number? raise StrConvError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please state the motivation for the PR and update the corresponding comments in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
1e98221
to
6044c10
Compare
Missing function signature update in parse_scientific callCategory Potential logic error in guard condition matchingCategory Inconsistent error handling pattern between parse functionsCategory // parse_number returns Option, parse_inf_nan raises exception |
parse_inf_nan
andparse_number
, moving the error handling logic inside them since they are only called in one place, avoiding the need to return the length.StringView::step
leverage contextual information for optimization.