Skip to content

Updating to Nom 7 has broken double("NaN") #1384

@StephenWakely

Description

@StephenWakely
╰─$ rustc -V                                                                                                                                                                           
rustc 1.54.0 (a178d0322 2021-07-26)

Given the following code:

use nom::{error::Error, number::complete::double};
fn main() {
    println!("{:?}", double::<_, Error<_>>("NaN"));
}

In Nom version 6, this runs and returns:

Ok(("", NaN))

In Nom version 7, this returns:

Err(Error(Error { input: "NaN", code: Float }))

Maybe this is intentional? I'm not seeing anything in the release notes about it, however.

Metadata

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