Skip to content

Parsing "-" as integer incorrectly gives Ok(0) #22745

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

Closed
krdln opened this issue Feb 24, 2015 · 1 comment
Closed

Parsing "-" as integer incorrectly gives Ok(0) #22745

krdln opened this issue Feb 24, 2015 · 1 comment

Comments

@krdln
Copy link
Contributor

krdln commented Feb 24, 2015

Assertion in the following code is accepted, which breaks the behaviour I was relying on.

fn main() {
    assert_eq!("-".parse(), Ok(0)); 
}

This bug has been present already on 2014-11-21.

It's one-line fix, I'll try making a PR.

@Aatch
Copy link
Contributor

Aatch commented Feb 24, 2015

Heh, that's kind of amusing.

@krdln krdln changed the title Parsing "-" as integer incorrectly gives Ok(0) Parsing "-" as integer incorrectly gives Ok(0) Feb 24, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Feb 24, 2015
@bors bors closed this as completed in 948a17e Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants