Skip to content

fix(clippy1): Trigger approx_constant lint rule instead of downgraded float_cmp. #890

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

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

frvannes16
Copy link
Contributor

@frvannes16 frvannes16 commented Dec 15, 2021

This PR fixes clippy1 for newer versions of Rust. When ran on rustc v1.57.0, clippy1 would pass without any changes. This was because the lint rule that clippy1 relies on (float_cmp) was recently downgraded.

This PR changes clippy1 and its hint to use a different lint rule: approx_constant. See approx_constant lint rule.

To satisfy clippy for this exercise, users must change line 14:

let pi = 3.14f32;

to

let pi = f32::consts::PI;

closes #888

@manyinsects manyinsects merged commit 969384c into rust-lang:main Dec 16, 2021
@manyinsects
Copy link
Member

@all-contributors please add @frvannes16 for code

@allcontributors
Copy link
Contributor

@diannasoreil

I've put up a pull request to add @frvannes16! 🎉

ppp3 pushed a commit to ppp3/rustlings that referenced this pull request May 23, 2022
fix(clippy1): Trigger approx_constant lint rule instead of downgraded float_cmp.
dmoore04 pushed a commit to dmoore04/rustlings that referenced this pull request Sep 11, 2022
fix(clippy1): Trigger approx_constant lint rule instead of downgraded float_cmp.
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.

clippy1.rs passed without any modifications
2 participants