rust-decimal
rust-decimal copied to clipboard
If `f64::try_from(value: Decimal)` is infallible, can we get method on `Decimal` that returns the unwrapped value?
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!
Previous implementations were returning None under edge cases that have since been handled. I'm not seeing any reason would couldn't have From<f64> implementations now.