Skip to content

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

Merged
imp2002 merged 2 commits intoTheAlgorithms:masterfrom
Rudxain:majority
May 9, 2026
Merged

feat(moore_voting)!: generic, refactor, const, etc...#1035
imp2002 merged 2 commits intoTheAlgorithms:masterfrom
Rudxain:majority

Conversation

@Rudxain
Copy link
Copy Markdown
Contributor

@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-commenter commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.82%. Comparing base (c4c395f) to head (b3c8d6d).

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.95%   95.82%   -0.14%     
==========================================
  Files         393      393              
  Lines       29919    29972      +53     
==========================================
+ Hits        28710    28721      +11     
- Misses       1209     1251      +42     

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

@imp2002 imp2002 merged commit 37c9e12 into TheAlgorithms:master May 9, 2026
7 checks passed
@Rudxain Rudxain deleted the majority branch May 9, 2026 04:11
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.

4 participants