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

Fix f32 and f64 #65

Merged
merged 3 commits into from
Aug 30, 2020
Merged

Fix f32 and f64 #65

merged 3 commits into from
Aug 30, 2020

Conversation

therustmonk
Copy link
Contributor

The crate doesn't always handle floats correctly. For example it can panic for NaN value in From<f32> implementation, but later it wrapped with Some(_) that will never work.

This PR fixes how the library works with floats and offers TryFrom implementation instead of From.

Also I've fixed some deprecation warnings.

@codecov-commenter
Copy link

Codecov Report

Merging #65 into master will decrease coverage by 0.35%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
- Coverage   95.20%   94.84%   -0.36%     
==========================================
  Files           2        2              
  Lines        1438     1436       -2     
==========================================
- Hits         1369     1362       -7     
- Misses         69       74       +5     
Impacted Files Coverage Δ
src/macros.rs 80.00% <ø> (ø)
src/lib.rs 95.00% <100.00%> (-0.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd06e21...dc660f2. Read the comment docs.

@vlmutolo
Copy link

vlmutolo commented Aug 24, 2020

Just want to say thanks for taking this on! There's actually a bug in Nushell that results from problems that this PR fixes. I was trying to figure out how to make these changes myself when I found your patch.

@akubera
Copy link
Owner

akubera commented Aug 30, 2020

Thanks. I was trying to avoid excluding versions of rust supported by the num-bigint crate (currently limited to 1.31), but I think TryFrom (1.34 -- from over a year ago!) is a good enough reason to bump the min-version.

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

Successfully merging this pull request may close these issues.

None yet

4 participants