github / github/rust-gems

Allow empty `ConsistentPermutation`

オープン 初心者向け
#159 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
134
フォーク
24
平均マージ
16時間 27分
マージ済み PR(30日)
11

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

crates/consistent-choose-k/src/consistent_permutation.rs から始め、特に 156 行目の assertion と、issue で言及されている次の関数を確認してください。現在 n = 0 がどのように扱われているかを検証し、呼び出し側で特別な場合分けをせずに空の置換を構築できることを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
tooling
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
82/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。