Skip to content

Commit 9ea2e92

Browse files
committed
Don't use references to TaprootMerkleBranchBuf
The new unsized type is more flexible and so are the references to it. Just like we pass around `&str` instead of `&String` we should be passing `&TaprootMerkleBranch` instead of `&TaprootMerkleBranchBuf`.
1 parent c528f52 commit 9ea2e92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bitcoin/src/taproot/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,9 +1096,9 @@ impl LeafNode {
10961096
pub fn leaf_version(&self) -> Option<LeafVersion> { self.leaf.as_script().map(|x| x.1) }
10971097

10981098
/// Returns reference to the Merkle proof (hashing partners) to get this
1099-
/// node in form of [`TaprootMerkleBranchBuf`].
1099+
/// node in form of [`TaprootMerkleBranch`].
11001100
#[inline]
1101-
pub fn merkle_branch(&self) -> &TaprootMerkleBranchBuf { &self.merkle_branch }
1101+
pub fn merkle_branch(&self) -> &TaprootMerkleBranch { &self.merkle_branch }
11021102

11031103
/// Returns a reference to the leaf of this [`ScriptLeaf`].
11041104
#[inline]
@@ -1114,7 +1114,7 @@ pub struct ScriptLeaf<'leaf> {
11141114
/// The script.
11151115
script: &'leaf Script,
11161116
/// The Merkle proof (hashing partners) to get this node.
1117-
merkle_branch: &'leaf TaprootMerkleBranchBuf,
1117+
merkle_branch: &'leaf TaprootMerkleBranch,
11181118
}
11191119

11201120
impl<'leaf> ScriptLeaf<'leaf> {
@@ -1125,7 +1125,7 @@ impl<'leaf> ScriptLeaf<'leaf> {
11251125
pub fn script(&self) -> &Script { self.script }
11261126

11271127
/// Obtains a reference to the Merkle proof of the leaf.
1128-
pub fn merkle_branch(&self) -> &TaprootMerkleBranchBuf { self.merkle_branch }
1128+
pub fn merkle_branch(&self) -> &TaprootMerkleBranch { self.merkle_branch }
11291129

11301130
/// Obtains a script leaf from the leaf node if the leaf is not hidden.
11311131
pub fn from_leaf_node(leaf_node: &'leaf LeafNode) -> Option<Self> {

0 commit comments

Comments
 (0)