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 clippy warnings #584
Open
albertsgarde
wants to merge
44
commits into
rust-bio:master
Choose a base branch
from
albertsgarde:fix-clippy-warnings
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace `'-' as u8` with `b'-'`
Since `seq_pretty` and `sequences` have the same length, this should be equivalent.
Also move the `is_empty` into the parentheses to simplify expression.
The original clippy lint was to use a `for` loop instead of a `while let`, but I this was an obvious improvement as well.
This also allows destructuring the elements of `max_in_column` into `score` and `col_max_row`, which makes the loop easier to read. Also couldn't stop myself from renaming `j` to `col_index`.
Clippy has a warning against `vec!` macro calls with a single range as argument. This is usually an error as described on their website, but in this case it is in fact what we want, so we disable the warning for this specific test.
Also use `zip` iterator instead of indexing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes all but one clippy warning throughout the repo.
Unfortunately, this means changing a lot of files, though luckily all changes are confined to only a few lines.
The only clippy warning left is the one complaining that the
pairhmm
module has a child calledpairhmm
. I didn't want toallow
the warning, and changing the module name is not something I wanted to make a decision about.I considered splitting this PR up on a per module basis in order to potentially make it easier to merge, but I thought I'd start off like this. Each commit only changes a single file and only fixes a single clippy warning, so it should be pretty simple to cherry pick.