Small code improvements.

This commit is contained in:
Rodolfo Araujo 2019-11-17 22:10:40 -03:00
parent a4ccab7431
commit 825493bea9
1 changed files with 4 additions and 1 deletions

View File

@ -247,6 +247,9 @@ impl SerializedSignature {
pub fn from_signature(sig: &Signature) -> SerializedSignature {
sig.serialize_der()
}
/// Check if the space is zero.
pub fn is_empty(&self) -> bool { self.len() == 0 }
}
impl Signature {
@ -548,7 +551,7 @@ impl Default for SerializedSignature {
impl PartialEq for SerializedSignature {
fn eq(&self, other: &SerializedSignature) -> bool {
&self.data[..self.len] == &other.data[..other.len]
self.data[..self.len] == other.data[..other.len]
}
}