BurntSushi / BurntSushi/quickcheck

Can 'gen_range' be made public?

Open
#326 1 comment 10 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.8k
Forks
165
PR merge metrics
No merged PRs in 30d

Description

Trying to write a fast arbitrary for a jagged vector, where I don't have to allocate N times.

After seeing how arbitrary is done for vec, it'd be useful to be able to riff on that code:

```rust
fn arbitrary(g: &mut Gen) -> Vec {
let size = {
let s = g.size();
g.gen_range(0..s)
};
(0..size).map(|_| A::arbitrary(g)).collect()
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.