Released YYYY-MM-DD.
Released 2020-01-22.
This is technically a breaking change, but we expect that nearly everyone should be able to upgrade without any compilation errors. The only exception is if you were implementing the Arbitrary::size_hint
method by hand. If so, see the “changed” section below and the API docs for Arbitrary::shrink
for details.
arbitary::size_hint::recursion_guard
helper function for guarding against infinite recursion in size_hint
implementations for recursive types.Arbitrary::size_hint
signature now takes a depth: usize
parameter. This should be passed along unmodified to any nested calls of other size_hint
methods. If you're implementing size_hint
for a recursive type (like a linked list or tree) or a generic type with type parameters, you should use the new arbitrary::size_hint::recursion_guard
helper function.size_hint
implementations from #[derive(Arbitrary)]
for recursive types.Released 2020-01-16.
Released 2020-01-15.
Unstructured::int_in_range
that would incorrectly trigger when given valid ranges of length one.Released 2020-01-14.
Released 2020-01-14.
"derive"
cargo feature, to enable #[derive(Arbitrary)]
for custom types. Enabling this feature re-exports functionality from the derive_arbitrary
crate.Arbitrary
implements the shrink method for you now.Arbitrary
for std
types implement shrinking now.Arbitrary::arbitrary_take_rest
method allows an Arbitrary
implementation to consume all of the rest of the remaining raw input. It has a default implementation that forwards to Arbitrary::arbitrary
and the custom derive creates a smart implementation for your custom types.Arbitrary::size_hint
method for hinting how many raw bytes an implementation needs to construct itself. This has a default implementation, but the custom derive creates a smart implementation for your custom types.Unstructured::choose
method to choose one thing among a set of choices.Unstructured::arbitrary_len
method to get an arbitrary length for a collection of some arbitrary type.Unstructured::arbitrary_iter
method to create an iterator of arbitrary instance of some type.Arbitrary
trait was simplified a bit.Unstructured
is a concrete type now, not a trait.RingBuffer
and FiniteBuffer
are removed. Use Unstructured
instead.Arbitrary
implementation for char
.Arbitrary
implementation for String
.