Change `Deref::Target` of `TaprootMerkleBranchBuf`

`TaprootMerkleBranchBuf` previously derefed to a slice which lost the
information about length being valid. This commit changes the type
which, while API-breaking, is not disruptive because the type has API
very similar to slice.
This commit is contained in:
Martin Habovstiak 2025-03-16 20:00:21 +01:00
parent 04a4efbe63
commit c528f52894
1 changed files with 3 additions and 3 deletions

View File

@ -181,15 +181,15 @@ impl<'a> IntoIterator for &'a mut TaprootMerkleBranchBuf {
}
impl core::ops::Deref for TaprootMerkleBranchBuf {
type Target = [TapNodeHash];
type Target = TaprootMerkleBranch;
#[inline]
fn deref(&self) -> &Self::Target { &self.0 }
fn deref(&self) -> &Self::Target { self.as_ref() }
}
impl core::ops::DerefMut for TaprootMerkleBranchBuf {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
fn deref_mut(&mut self) -> &mut Self::Target { self.as_mut() }
}
impl AsRef<[TapNodeHash]> for TaprootMerkleBranchBuf {