Skip to content

Commit 49fd7b9

Browse files
committed
Remove hashbrown dependency
Feature guard implementations of `Satisfier` on `HashMap` on the "std" feature. We then no longer require the `hashbrown` dependency sine we use `BTreeMap` and `BTreeSet` everywhere else.
1 parent 4e174e1 commit 49fd7b9

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ edition = "2018"
1313
[features]
1414
default = ["std"]
1515
std = ["bitcoin/std", "bitcoin/secp-recovery"]
16-
no-std = ["hashbrown", "bitcoin/no-std"]
16+
no-std = ["bitcoin/no-std"]
1717
compiler = []
1818
trace = []
1919

@@ -23,7 +23,6 @@ base64 = ["bitcoin/base64"]
2323

2424
[dependencies]
2525
bitcoin = { version = "0.30.0", default-features = false }
26-
hashbrown = { version = "0.11", optional = true }
2726
internals = { package = "bitcoin-private", version = "0.1.0", default_features = false }
2827

2928
# Do NOT use this as a feature! Use the `serde` feature instead.

src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ pub use bitcoin;
100100
#[macro_use]
101101
extern crate alloc;
102102

103-
#[cfg(not(feature = "std"))]
104-
extern crate hashbrown;
105-
106103
#[cfg(any(feature = "std", test))]
107104
extern crate core;
108105

@@ -961,9 +958,6 @@ mod prelude {
961958
vec::Vec,
962959
};
963960

964-
#[cfg(all(not(feature = "std"), not(test)))]
965-
pub use hashbrown::{HashMap, HashSet};
966-
967961
#[cfg(all(not(feature = "std"), not(test)))]
968962
pub use self::mutex::Mutex;
969963
}

src/miniscript/satisfy.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ impl_satisfier_for_map_key_to_ecdsa_sig! {
172172
}
173173

174174
impl_satisfier_for_map_key_to_ecdsa_sig! {
175+
#[cfg(feature = "std")]
175176
impl Satisfier<Pk> for HashMap<Pk, bitcoin::ecdsa::Signature>
176177
}
177178

@@ -201,6 +202,7 @@ impl_satisfier_for_map_key_hash_to_taproot_sig! {
201202
}
202203

203204
impl_satisfier_for_map_key_hash_to_taproot_sig! {
205+
#[cfg(feature = "std")]
204206
impl Satisfier<Pk> for HashMap<(Pk, TapLeafHash), bitcoin::taproot::Signature>
205207
}
206208

@@ -236,6 +238,7 @@ impl_satisfier_for_map_hash_to_key_ecdsa_sig! {
236238
}
237239

238240
impl_satisfier_for_map_hash_to_key_ecdsa_sig! {
241+
#[cfg(feature = "std")]
239242
impl Satisfier<Pk> for HashMap<hash160::Hash, (Pk, bitcoin::ecdsa::Signature)>
240243
}
241244

@@ -272,6 +275,7 @@ impl_satisfier_for_map_hash_tapleafhash_to_key_taproot_sig! {
272275
}
273276

274277
impl_satisfier_for_map_hash_tapleafhash_to_key_taproot_sig! {
278+
#[cfg(feature = "std")]
275279
impl Satisfier<Pk> for HashMap<(hash160::Hash, TapLeafHash), (Pk, bitcoin::taproot::Signature)>
276280
}
277281

0 commit comments

Comments
 (0)