-
Notifications
You must be signed in to change notification settings - Fork 86
fix: Fix new clippy warnings #79
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: Fix new clippy warnings #79
Conversation
There is still an error with this clippy::suspicious-operation-groupings. Could you check that @VolodymyrOrlov? It looks to me that we can ignore that warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -265,7 +266,7 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug { | |||
sum += xi * xi; | |||
} | |||
mu /= div; | |||
sum / div - mu * mu | |||
sum / div - mu.powi(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering what is faster in Rust, mu * mu or mu.powi(2)? I always thought that multiplication is faster but that might not be true in Rust. This might be a small thing, but if repeated many times the difference will accumulate to a significant value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, the warnings I see do not make any sense. The logic that is highlighted by the lint is correct |
Codecov Report
@@ Coverage Diff @@
## development #79 +/- ##
===============================================
- Coverage 84.17% 84.09% -0.08%
===============================================
Files 78 78
Lines 8081 8080 -1
===============================================
- Hits 6802 6795 -7
- Misses 1279 1285 +6
Continue to review full report at Codecov.
|
Merging because it already was approved |
This fixes the clippy warnings added in the new version of clippy