Skip to content

If f64::try_from(value: Decimal) is infallible, can we get method on Decimal that returns the unwrapped value? #699

@hirenhpatel

Description

@hirenhpatel

I manually inspected the implementation of converting Decimal to f64 and found that it can never return None. Do I have this right?

If so, would you be able to provide an infallible method directly on Decimal to make this conversion? Right now I have a bunch of f64::try_from(value).expect("infallible by manual inspection") which makes it very difficult to maintain a no-panic codebase.

thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions