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

refactor: enforce nonegative inputs by using u32 in lucas_series #640

Merged
merged 3 commits into from
Dec 31, 2023

Conversation

vil02
Copy link
Member

@vil02 vil02 commented Dec 30, 2023

Description

This PR simplifies the logic in lucas_series.rs by changing the input type to u32. Thanks to that, the input is nonnegative.

Besides that there were some small cosmetic changes made. New test cases were verified with oeis:A000032.

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

@codecov-commenter
Copy link

codecov-commenter commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2fbcfcc) 94.53% compared to head (d63e11c) 94.54%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #640   +/-   ##
=======================================
  Coverage   94.53%   94.54%           
=======================================
  Files         278      278           
  Lines       22342    22342           
=======================================
+ Hits        21122    21124    +2     
+ Misses       1220     1218    -2     

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

@vil02 vil02 marked this pull request as ready for review December 30, 2023 12:05
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit 17517c0 into TheAlgorithms:master Dec 31, 2023
4 checks passed
@vil02 vil02 deleted the simplify_lucas_series branch December 31, 2023 10:02
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

3 participants