Skip to content

NotNan::new can be const #170

Description

@bentheiii

Hello. AFAICT, there's no reason for NotNan::new to not be const. This will allow users to safely unwrap float literals in a const context.

let my_default_non_nan_float = const {NotNan::new(0.5).unwrap()};

I'd be happy to make a PR if this is approved

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions