github / github/rust-gems

Allow empty `ConsistentPermutation`

Aperta Adatta ai principianti
#159 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
134
Fork
24
Merge medio
16h 27m
PR unite (30g)
11

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
82/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.