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

Recommended solution for excessive precision is detected as an error #5573

Closed
bugadani opened this issue May 6, 2020 · 1 comment
Closed

Comments

@bugadani
Copy link
Contributor

bugadani commented May 6, 2020

cargo clippy -V
clippy 0.0.212 (891e1a85 2020-04-18)

I had the following f32 literal: 0.000110694319115641.
Clippy recommends truncating it to 0.000_110_694_32. So far, so good.
After I replace it, and run cargo clippy again, I'm facing the following output:

43 |     0.000_110_694_32,
   |     ^^^^^^^^^^^^^^^^ help: did you mean to write: `0.000_110_694_f32`

I understand the idea behind the mistyped suffix check and I know I can make it go away by adding #[allow(clippy::mistyped_literal_suffixes)] but it would be nice if clippy didn't recommend something it would fail on the next time.

@flip1995
Copy link
Member

flip1995 commented May 6, 2020

Duplicate of #4706

@flip1995 flip1995 marked this as a duplicate of #4706 May 6, 2020
@flip1995 flip1995 closed this as completed May 6, 2020
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