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

Make some code suggestions #9

Merged
merged 6 commits into from Feb 3, 2022
Merged

Conversation

pvanheus
Copy link
Contributor

@pvanheus pvanheus commented Feb 2, 2022

This PR doesn't change the functionality of the code but rather makes some suggestions in line with Rust idioms. The biggest change is in populate_primer_count_hash where let key = if replaces the double-assignment of key and is_some is used at the insert step and then the rewrite of import_primer_sets to reduce use of mut and prefer a more "functional" style to a more "C-like" approach of initialising and then updating a hashmap.

Further down the code identify_primer_sets has an if-chain replaced with a match based on a clippy suggestion. I'm less sure that this is an improvement - it uses match rather than an if-chain, which is more ideomatic for Rust, but the use of Ordering::Equal etc might make things less readable to some users.

@bwlang bwlang merged commit a90ccbd into nebiolabs:main Feb 3, 2022
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.

None yet

2 participants