You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'tests::quickcheck_test' panicked at 'cannot sample empty range', /Users/nipunn/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.5/src/rng.rs:134:9
I think it would logically make more sense to change this line to
g.gen_range(0..s+1)
Here, a size of 0 would represent a distribution that creates an empty Vec 100% of the time rather than panicking. Currently size=1 represents this, which I find confusing.
This can be helpful for custom Arbitrary implementations that intentionally reduce the size parameter in a way to ensure a bounded depth for recursive structures.
The text was updated successfully, but these errors were encountered:
See here
https://docs.rs/quickcheck/1.0.3/src/quickcheck/arbitrary.rs.html#255
If it is set to 0, we get
I think it would logically make more sense to change this line to
Here, a size of 0 would represent a distribution that creates an empty Vec 100% of the time rather than panicking. Currently
size=1
represents this, which I find confusing.This can be helpful for custom Arbitrary implementations that intentionally reduce the
size
parameter in a way to ensure a bounded depth for recursive structures.The text was updated successfully, but these errors were encountered: