Add `as_mut_slice` to `TaprootMerkleBranchBuf`

`TaprootMerkleBranchBuf` already had `as_slice` method and `DerefMut`
but was missing `as_slice_mut`, so this change adds it.
This commit is contained in:
Martin Habovstiak 2025-03-16 10:17:49 +01:00
parent 33d75659da
commit 370c2597c6
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,10 @@ impl TaprootMerkleBranchBuf {
#[inline]
pub fn as_slice(&self) -> &[TapNodeHash] { &self.0 }
/// Returns a mutable reference to the slice of hashes.
#[inline]
pub fn as_mut_slice(&mut self) -> &mut [TapNodeHash] { &mut self.0 }
/// Returns the number of nodes in this Merkle proof.
#[inline]
pub fn len(&self) -> usize { self.0.len() }