Skip to content

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

Closed
@krdln

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions