github / github/rust-gems

Allow empty `ConsistentPermutation`

Abierto Apto para principiantes
#159 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
134
Forks
24
Merge medio
16 h 27 min
PR fusionados (30 d)
11

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
82/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.