Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about std and alloc features to readme #290

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,17 @@ released at least six months ago. The current MSRV is 1.65.0.
Note that the MSRV is not increased automatically, and only as part of a minor
release.

## Feature flags
## `std` and other Feature flags

There is support for a number of crates. These are enabled by setting the identically
named feature flag.
Uint enables the `std` feature by default. It can be used in `no_std`
environments by disabling default features. For environments with allocators
but without `std`, the `alloc` feature flag enables use of collections,`String`, and `Vec` without `std`.

In addition to `std` and `alloc`, feature flags enable support for a number of
crates. These are enabled by setting the identically named feature flag.

* `unstable` Enable sem-ver unstable features.
* `std`:
* [`rand`](https://docs.rs/rand): Implements sampling from the [`Standard`](https://docs.rs/rand/latest/rand/distributions/struct.Standard.html) distribution, i.e. [`rng.gen()`](https://docs.rs/rand/latest/rand/trait.Rng.html#method.gen).
* [`arbitrary`](https://docs.rs/arbitrary): Implements the [`Arbitrary`](https://docs.rs/arbitrary/latest/arbitrary/trait.Arbitrary.html) trait, allowing [`Uint`]s to be generated for fuzz testing.
* [`quickcheck`](https://docs.rs/quickcheck): Implements the [`Arbitrary`](https://docs.rs/quickcheck/latest/quickcheck/trait.Arbitrary.html) trait, allowing [`Uint`]s to be generated for property based testing.
Expand Down