Skip to content

[Rust] incorrect comparison with f64::NAN #895

Closed
@alazarev-io

Description

@alazarev-io

The generator produces for the optional double the following code:

    if value == f64::NAN {
        None
    } else {
        Some(value)
    }

But the comparison if value == f64::NAN is always false, it needs to use if value.is_nan() instead.

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