You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indeed, I hacked a bit around, and it just makes sense to have a Number(i64) variant to cover the everyday usage.
We could imagine some kind of variants for larger numbers, but the toml::Value enum would be much more of a burden (many variants to take care of).
I guess the best way would be to have:
enumValue{// other variants ...Number(NumberValue),}enumNumberValue{Unsigned(u64),Signed(i64),BigUnsigned(u128),BigSigned(i128),Float(f64),}implTryInto<u64>forNumberValue{// If the variant matches, get the value, else raise an error}
It forces an extra step to get a usable number from the toml::Value, but it covers all kind of numeric types we could want.
Seams to me like a good middle ground
Past issue: toml-rs/toml-rs#256
u64
cannot be deserialized as it's backed by ai64
formatThis causes this to fail:
And any number
> i64::MAX
will also fail.The text was updated successfully, but these errors were encountered: