Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FromPrimitive i128/u128 typo #329

Closed
teoxoy opened this issue Mar 28, 2021 · 2 comments
Closed

FromPrimitive i128/u128 typo #329

teoxoy opened this issue Mar 28, 2021 · 2 comments
Milestone

Comments

@teoxoy
Copy link
Contributor

teoxoy commented Mar 28, 2021

There is a typo in the conversion functions for i128/u128:

rust-decimal/src/decimal.rs

Lines 2995 to 2998 in d96f762

#[cfg(has_i128)]
impl_from!(i128, FromPrimitive::from_i28);
#[cfg(has_i128)]
impl_from!(u128, FromPrimitive::from_u28);

Should be:

  • from_i28 -> from_i128
  • from_u28 -> from_u128

For reference, here are the functions in question from num-traits crate

@paupino
Copy link
Owner

paupino commented Mar 29, 2021

Good catch. Also demonstrates some missing build steps/tests - I'll try to get this addressed sometime this week.

@paupino paupino added this to the v1.11 milestone Mar 29, 2021
paupino added a commit that referenced this issue Mar 31, 2021
Implements u128/i128 parsing correctly (Fixes #329)
@paupino
Copy link
Owner

paupino commented Mar 31, 2021

The from_i128/from_u128 had quite a few issues however was almost never compiled in to the library due to a misconfiguration. Nonetheless, it should now be working correctly and has surrounding tests to ensure it continues to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants