diff --git a/Cargo.toml b/Cargo.toml index f4605c0..41cfa5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,11 +49,11 @@ serde = { version = "1.0", default-features = false, features = [ "alloc" ], opt zeroize = { version = "1.5", features = ["zeroize_derive"], optional = true } # Unexported dependnecies -bitcoin_hashes = { version = ">=0.12, <=0.13", default-features = false } +bitcoin_hashes = { version = ">=0.12, <=0.14", default-features = false, features = ["alloc"] } unicode-normalization = { version = "=0.1.22", default-features = false, optional = true } [dev-dependencies] -bitcoin_hashes = ">=0.12,<0.14" # enable default features for test +bitcoin_hashes = ">=0.12,<=0.14" # enable default features for test [package.metadata.docs.rs] diff --git a/README.md b/README.md index c97c10d..ccc5c0f 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ The `bitcoin_hashes` range dependency effects the MSRV as follows - `bitcoin_hashes v0.12`: MSRV v1.41.1 - `bitcoin_hashes v0.13`: MSRV v1.48.0 +- `bitcoin_hashes v0.14`: MSRV v1.56.1 When using older version of Rust, you might have to pin the version of the `bitcoin_hashes` crate used as such: diff --git a/src/internal_macros.rs b/src/internal_macros.rs index 4d4ece1..707effe 100644 --- a/src/internal_macros.rs +++ b/src/internal_macros.rs @@ -10,6 +10,7 @@ macro_rules! serde_string_impl { { use core::fmt::{self, Formatter}; use core::str::FromStr; + #[cfg(feature = "alloc")] use alloc::string::String; struct Visitor; @@ -34,6 +35,7 @@ macro_rules! serde_string_impl { self.visit_str(v) } + #[cfg(feature = "alloc")] fn visit_string(self, v: String) -> Result where E: $crate::serde::de::Error, diff --git a/src/lib.rs b/src/lib.rs index 463a887..7bed102 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -622,6 +622,7 @@ impl Mnemonic { /// following assertion should hold: /// /// ```rust + /// # # [cfg(feature = "alloc")] { /// # use bip39::Mnemonic; /// # use bitcoin_hashes::{Hash, sha256, hex::FromHex}; /// # let ent = Vec::from_hex("98FE3D0FF6E955A484B0A1D0C9CE10F6").unwrap(); @@ -629,6 +630,7 @@ impl Mnemonic { /// let checksum_width = m.word_count() / 3; /// let shift_width = 8 - checksum_width; /// assert_eq!(sha256::Hash::hash(&m.to_entropy())[0] >> shift_width, m.checksum()); + /// # } /// ``` /// /// Note that since this library constrains initialization of `Mnemonic` instances through an