alloy-rs / alloy-rs/ruint

`support/arbitrary`: We should use `rand` in tests, not `arbitrary`.

未關閉
#197 0 則留言 0 個 reaction 已指派 1 人 已被 @recmo 認領 在 GitHub 檢視
to do tracker
主要語言
Rust
星號
225
分支
70
平均合併
16 小時 54 分鐘
30 天內合併 PR
8

描述

*On 2022-10-28 @recmo wrote in [`49f6271`](https://github.com/recmo/uint/commit/49f6271d9967c55a71f588ed267387b57a285d43) “Merge pull request #195 from recmo/pow2”:*

We should use `rand` in tests, not `arbitrary`.

```rust

// TODO: Instead of uniform random sampling, we should use a distribution that
// exercises different scales more. Something like sum(±2ⁱ for random i). The
// reduction step can then remove terms or make them smaller.

// TODO: We should use `rand` in tests, not `arbitrary`.

impl<'a, const BITS: usize, const LIMBS: usize> Arbitrary<'a> for Uint {
fn arbitrary(u: &mut Unstructured<'a>) -> Result {
let mut limbs = [0; LIMBS];
if let Some((last, rest)) = limbs.split_last_mut() {

```
*From [`src/support/arbitrary.rs:11`](https://github.com/recmo/uint/blob/49f6271d9967c55a71f588ed267387b57a285d43/src/support/arbitrary.rs#L11)*

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。