Merge pull request #41 from rust-bitcoin/msrv-1.41
Enable 2018 edition, bump MSRV to 1.41 and bump to v2.0.0
This commit is contained in:
commit
a30760beac
|
@ -1,6 +1,15 @@
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
# v2.0.0
|
||||||
|
|
||||||
|
- Set Rust edition to 2018
|
||||||
|
- Make `rand` and `rand_core` dependencies more flexible
|
||||||
|
- Increase maximum version in constraint
|
||||||
|
- Make `rand_core` optional too
|
||||||
|
- Expose both crates
|
||||||
|
- Bump MSRV to 1.41.1
|
||||||
|
|
||||||
# v1.2.0
|
# v1.2.0
|
||||||
|
|
||||||
- Add `Mnemonic::parse_in_normalized_without_checksum_check`
|
- Add `Mnemonic::parse_in_normalized_without_checksum_check`
|
||||||
|
|
25
Cargo.toml
25
Cargo.toml
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bip39"
|
name = "bip39"
|
||||||
version = "1.2.0"
|
version = "2.0.0"
|
||||||
authors = ["Steven Roose <steven@stevenroose.org>"]
|
authors = ["Steven Roose <steven@stevenroose.org>"]
|
||||||
license = "CC0-1.0"
|
license = "CC0-1.0"
|
||||||
homepage = "https://github.com/rust-bitcoin/rust-bip39/"
|
homepage = "https://github.com/rust-bitcoin/rust-bip39/"
|
||||||
|
@ -9,14 +9,12 @@ documentation = "https://docs.rs/bip39/"
|
||||||
description = "Library for BIP-39 Bitcoin mnemonic codes"
|
description = "Library for BIP-39 Bitcoin mnemonic codes"
|
||||||
keywords = [ "crypto", "bitcoin", "bip39", "mnemonic" ]
|
keywords = [ "crypto", "bitcoin", "bip39", "mnemonic" ]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
edition = "2018"
|
||||||
[lib]
|
|
||||||
name = "bip39"
|
|
||||||
path = "src/lib.rs"
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "std" ]
|
default = [ "std" ]
|
||||||
std = [ "unicode-normalization", "serde/std" ]
|
std = [ "unicode-normalization", "serde/std" ]
|
||||||
|
rand = [ "crate_rand", "rand_core" ]
|
||||||
|
|
||||||
# Note: English is the standard for bip39 so always included
|
# Note: English is the standard for bip39 so always included
|
||||||
chinese-simplified = []
|
chinese-simplified = []
|
||||||
|
@ -40,16 +38,19 @@ all-languages = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitcoin_hashes = { version = "0.11.0", default-features = false }
|
rand_core = { version = ">=0.4.0, <0.7.0", optional = true }
|
||||||
rand_core = "0.4.0"
|
crate_rand = { package = "rand", version = ">=0.6.0, <0.9.0", optional = true }
|
||||||
|
|
||||||
unicode-normalization = { version = "=0.1.9", optional = true }
|
|
||||||
rand = { version = "0.6.0", optional = true }
|
|
||||||
serde = { version = "1.0", default-features = false, features = [ "alloc" ], optional = true }
|
serde = { version = "1.0", default-features = false, features = [ "alloc" ], optional = true }
|
||||||
|
|
||||||
# Enabling this feature raises the MSRV to 1.51
|
# Enabling this feature raises the MSRV to 1.51
|
||||||
zeroize = {version = "1.5", features = ["zeroize_derive"], optional = true}
|
zeroize = { version = "1.5", features = ["zeroize_derive"], optional = true }
|
||||||
|
|
||||||
|
# Unexported dependnecies
|
||||||
|
bitcoin_hashes = { version = "0.11.0", default-features = false }
|
||||||
|
unicode-normalization = { version = "=0.1.22", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rand = { version = "0.6.0", optional = false }
|
rand_core = { version = "0.6.4", optional = false }
|
||||||
|
crate_rand = { package = "rand", version = "0.8.5", optional = false }
|
||||||
bitcoin_hashes = "0.11.0" # enable default features for test
|
bitcoin_hashes = "0.11.0" # enable default features for test
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,6 @@ Use the `all-languages` feature to enable all languages.
|
||||||
|
|
||||||
## MSRV
|
## MSRV
|
||||||
|
|
||||||
This crate supports Rust v1.29 and up and works with `no_std`.
|
This crate supports Rust v1.41.1 and up and works with `no_std`.
|
||||||
|
|
||||||
If you enable the `zeroize` feature the MSRV becomes 1.51
|
If you enable the `zeroize` feature the MSRV becomes 1.51.
|
||||||
|
|
|
@ -31,13 +31,14 @@ pub extern crate core;
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
extern crate bitcoin_hashes;
|
extern crate bitcoin_hashes;
|
||||||
extern crate rand_core;
|
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
extern crate unicode_normalization;
|
extern crate unicode_normalization;
|
||||||
|
|
||||||
|
#[cfg(feature = "rand_core")]
|
||||||
|
pub extern crate rand_core;
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
extern crate rand;
|
pub extern crate crate_rand as rand;
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
pub extern crate serde;
|
pub extern crate serde;
|
||||||
|
|
||||||
|
@ -248,14 +249,14 @@ impl Mnemonic {
|
||||||
/// Example:
|
/// Example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// extern crate rand;
|
|
||||||
/// extern crate bip39;
|
/// extern crate bip39;
|
||||||
///
|
///
|
||||||
/// use bip39::{Mnemonic, Language};
|
/// use bip39::{Mnemonic, Language};
|
||||||
///
|
///
|
||||||
/// let mut rng = rand::thread_rng();
|
/// let mut rng = bip39::rand::thread_rng();
|
||||||
/// let m = Mnemonic::generate_in_with(&mut rng, Language::English, 24).unwrap();
|
/// let m = Mnemonic::generate_in_with(&mut rng, Language::English, 24).unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
|
#[cfg(feature = "rand_core")]
|
||||||
pub fn generate_in_with<R>(
|
pub fn generate_in_with<R>(
|
||||||
rng: &mut R,
|
rng: &mut R,
|
||||||
language: Language,
|
language: Language,
|
||||||
|
|
Loading…
Reference in New Issue