Deduplicate `self.data[..self.len]` expressions

This removes the duplication ensuring single source of truth and making
the code simpler.
This commit is contained in:
Martin Habovstiak 2022-06-21 19:20:20 +02:00
parent a1ac3fb311
commit 1d2a1c3fee
1 changed files with 2 additions and 2 deletions

View File

@ -76,13 +76,13 @@ impl Default for SerializedSignature {
impl PartialEq for SerializedSignature {
fn eq(&self, other: &SerializedSignature) -> bool {
self.data[..self.len] == other.data[..other.len]
**self == **other
}
}
impl AsRef<[u8]> for SerializedSignature {
fn as_ref(&self) -> &[u8] {
&self.data[..self.len]
&*self
}
}