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

Remove clippy warnings #109

Merged
merged 12 commits into from
Mar 20, 2025
Merged

Remove clippy warnings #109

merged 12 commits into from
Mar 20, 2025

Conversation

nleroy917
Copy link
Member

@nleroy917 nleroy917 commented Mar 20, 2025

This is a fix for #105 .

I use clippy to improve my rust code, catch small things, etc. The current code base had >180 warnings that made it difficult for me to see true errors through the sea of warnings...

I want in and remove them by either 1) implementing the fix, or 2) manually suppressing the warning. Overwhelmingly, the warnings were small things like:

- cnt = cnt + 1;
+ cnt += 1;

or

- if obj == None
+ if obj.is_none()

There were some more elusive warnings about us passing references that get auto-dereferenced by the compiler.

All tests still pass.

@nleroy917 nleroy917 requested review from donaldcampbelljr and khoroshevskyi and removed request for donaldcampbelljr March 20, 2025 15:10
@nleroy917 nleroy917 changed the base branch from master to dev March 20, 2025 15:10
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 66.87500% with 53 lines in your changes missing coverage. Please review.

Project coverage is 63.74%. Comparing base (4136822) to head (24db482).
Report is 56 commits behind head on dev.

Files with missing lines Patch % Lines
gtars/src/uniwig/counting.rs 37.68% 43 Missing ⚠️
gtars/src/uniwig/mod.rs 80.76% 5 Missing ⚠️
gtars/src/igd/search.rs 83.33% 4 Missing ⚠️
gtars/src/common/utils.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #109      +/-   ##
==========================================
+ Coverage   61.97%   63.74%   +1.76%     
==========================================
  Files          38       36       -2     
  Lines        6478     5786     -692     
==========================================
- Hits         4015     3688     -327     
+ Misses       2463     2098     -365     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@donaldcampbelljr donaldcampbelljr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tested changes locally and it passes tests.

Comment on lines 135 to +136
let region = self.universe.borrow(py).convert_id_to_region(id);
match region {
Some(r) => Some(r.into()),
None => None,
}
region
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, for items like this, are we certain region will be None without the match statement?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think that the reason Clippy sked for this is that the match is redundant... if it matches Some, we immediately turn into Some again... If it matches None we immediately return None. I think that's why it had me change this.

@donaldcampbelljr
Copy link
Member

Thanks for doing this.

Copy link
Member

@khoroshevskyi khoroshevskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good!!

@nleroy917 nleroy917 merged commit 62436a3 into dev Mar 20, 2025
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.

3 participants