github / github/rust-gems

Allow empty `ConsistentPermutation`

Open Beginner friendly
#159 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
134
Forks
24
Avg merge
16h 27m
Merged PRs (30d)
11

Description

Is there any reason `ConsistentPermutation` doesn't allow `n` to be zero - as per [this assertion](https://github.com/github/rust-gems/blob/main/crates/consistent-choose-k/src/consistent_permutation.rs#L156).

This results in special casing when you're constructing the permutations. We might need a branch at the top of the `next` function to check, but it should be highly predictable.

Contributor guide

Open the contributing guide

Research direction

Start in crates/consistent-choose-k/src/consistent_permutation.rs, especially the assertion at line 156 and the next function mentioned in the issue. Verify how n = 0 is currently handled and confirm that empty permutations can be constructed without caller-side special casing.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.