Skip to content

feat(moore_voting)!: generic, refactor, const, etc...#1035

Open
Rudxain wants to merge 1 commit intoTheAlgorithms:masterfrom
Rudxain:majority
Open

feat(moore_voting)!: generic, refactor, const, etc...#1035
Rudxain wants to merge 1 commit intoTheAlgorithms:masterfrom
Rudxain:majority

Conversation

@Rudxain
Copy link
Copy Markdown

@Rudxain Rudxain commented Apr 10, 2026

Pull Request Template

Description

  • Replace i32 by generic param
  • Add implementation that handles finite iterables
  • Add fn that returns index instead of value
  • Return Options instead of ints
  • Add const implementations
  • Fix doc typo

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

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 added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • I added my algorithm to DIRECTORY.md with the correct link.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

Please make sure that if there is a test that takes too long to run ( > 300ms), you #[ignore] that or
try to optimize your code or make the test easier to run. We have this rule because we have hundreds of
tests to run; If each one of them took 300ms, we would have to wait for a long time.

@Rudxain Rudxain force-pushed the majority branch 2 times, most recently from 3f77a3e to f90fa80 Compare April 10, 2026 01:36
@Rudxain Rudxain marked this pull request as ready for review April 10, 2026 01:39
@Rudxain Rudxain requested a review from imp2002 as a code owner April 10, 2026 01:39
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.85%. Comparing base (6e42c38) to head (d035d2c).

Files with missing lines Patch % Lines
src/searching/moore_voting.rs 33.33% 42 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1035      +/-   ##
==========================================
- Coverage   95.99%   95.85%   -0.14%     
==========================================
  Files         390      390              
  Lines       29605    29658      +53     
==========================================
+ Hits        28420    28430      +10     
- Misses       1185     1228      +43     

☔ 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.

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.

2 participants