Allow empty `ConsistentPermutation`

Open Beginner friendly
#159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

Is there any reason ConsistentPermutation doesn't allow n to be zero - as per this assertion.

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.

Dominant language
Rust
Stars
134
Forks
24
Avg merge
16h 27m
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/rust-gems

All issues in github/rust-gems

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.