Skip to content

Commit

Permalink
Rename features
Browse files Browse the repository at this point in the history
crates.io doesn't like feature names encoded as strings, apparently.
  • Loading branch information
slowli committed Jul 4, 2019
1 parent ca8952e commit c1eb60c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ script:
- cargo check --tests --examples
- cargo test --lib --tests
- cargo test --doc
- cargo run --no-default-features --features rand-0.6 --example ed25519 > /dev/null
- cargo run --no-default-features --features rand-06 --example ed25519 > /dev/null
- cargo clean --doc && cargo doc --no-deps && cargo deadlinks --dir target/doc

deploy:
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ pwbox = { version = "0.1.4", default-features = false, features = ["rust-crypto"
toml = "0.5.1"

[features]
default = ["rand-0.7"]
"rand-0.6" = ["rand6", "rand6_chacha"]
"rand-0.7" = ["rand", "rand_chacha"]
default = ["rand-07"]
rand-06 = ["rand6", "rand6_chacha"]
rand-07 = ["rand", "rand_chacha"]

[[example]]
name = "ed25519"
path = "examples/ed25519.rs"
required-features = ["rand-0.6"]
required-features = ["rand-06"]
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
//! # Crate features
//!
//! The crate supports both `rand` v0.6 and v0.7 (the latter is used by default).
//! To signal the version, specify a `rand-0.6` or `rand-0.7` feature (naturally, they are mutually
//! exclusive). `rand-0.7` is on by default, so it is necessary to specify
//! `default-features = false` if using `rand-0.6`.
//! To signal the version, specify a `rand-06` or `rand-07` feature (naturally, they are mutually
//! exclusive). `rand-07` is on by default, so it is necessary to specify
//! `default-features = false` if using `rand-06`.
//!
//! [libsodium]: https://download.libsodium.org/doc/key_derivation
//! [Blake2b]: https://tools.ietf.org/html/rfc7693
Expand All @@ -130,14 +130,14 @@ use clear_on_drop::ClearOnDrop;
// and even this may not work (v0.7 may be used elsewhere).
//
// Older versions:
#[cfg(feature = "rand-0.6")]
#[cfg(feature = "rand-06")]
use rand6::{AsByteSliceMut, CryptoRng, RngCore, SeedableRng};
#[cfg(feature = "rand-0.6")]
#[cfg(feature = "rand-06")]
use rand6_chacha::ChaChaRng;
// Newer versions:
#[cfg(feature = "rand-0.7")]
#[cfg(feature = "rand-07")]
use rand::{AsByteSliceMut, CryptoRng, RngCore, SeedableRng};
#[cfg(feature = "rand-0.7")]
#[cfg(feature = "rand-07")]
use rand_chacha::ChaChaRng;

use std::fmt;
Expand Down

0 comments on commit c1eb60c

Please sign in to comment.