Skip to content

Commit 162e04b

Browse files
committed
Switch to BTreeMap from HashMap
1 parent 1675650 commit 162e04b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/models.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::HashMap;
1+
use std::collections::BTreeMap;
22

33
use bitcoin::PublicKey;
44

@@ -41,7 +41,7 @@ pub struct TapTweaks {
4141
/// Number of blocks in the response, up to 2,000.
4242
pub num_blocks: u32,
4343
/// The tweaks for each block.
44-
pub blocks: Vec<Option<HashMap<u32, String>>>,
44+
pub blocks: Vec<Option<BTreeMap<u32, String>>>,
4545
}
4646

4747
impl TapTweaks {
@@ -51,13 +51,13 @@ impl TapTweaks {
5151
/// # Panics
5252
///
5353
/// If the partial secret is not a valid hex encoding of a public key.
54-
pub fn fallible_into_iterator(self) -> impl Iterator<Item = Option<HashMap<u32, PublicKey>>> {
54+
pub fn fallible_into_iterator(self) -> impl Iterator<Item = Option<BTreeMap<u32, PublicKey>>> {
5555
self.blocks.into_iter().map(|tweaks| {
5656
tweaks.map(|tweaks| {
5757
tweaks
5858
.into_iter()
5959
.map(|(tx_index, pk_str)| (tx_index, pk_str.parse::<PublicKey>().unwrap()))
60-
.collect::<HashMap<u32, PublicKey>>()
60+
.collect::<BTreeMap<u32, PublicKey>>()
6161
})
6262
})
6363
}

0 commit comments

Comments
 (0)