Place ff_derive re-exports behind a feature

Part of #3.
This commit is contained in:
Jack Grigg 2018-07-02 21:08:24 +01:00
parent 002173e187
commit 69ce66ae6c
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
3 changed files with 12 additions and 1 deletions

View File

@ -14,6 +14,6 @@ rand = "0.4"
ff_derive = { version = "0.3.0", path = "ff_derive", optional = true }
[features]
default = ["derive"]
default = []
u128-support = []
derive = ["ff_derive"]

View File

@ -21,6 +21,15 @@ The `ff` crate contains `Field`, `PrimeField`, `PrimeFieldRepr` and `SqrtField`
If you need an implementation of a prime field, this library also provides a procedural macro that will expand into an efficient implementation of a prime field when supplied with the modulus. `PrimeFieldGenerator` must be an element of Fp of p-1 order, that is also quadratic nonresidue.
First, enable the `derive` crate feature:
```toml
[dependencies]
ff = { version = "0.3", features = ["derive"] }
```
And then use the macro like so:
```rust
extern crate rand;
#[macro_use]

View File

@ -3,9 +3,11 @@
extern crate byteorder;
extern crate rand;
#[cfg(feature = "derive")]
#[macro_use]
extern crate ff_derive;
#[cfg(feature = "derive")]
pub use ff_derive::*;
use std::error::Error;