Skip to content

Commit

Permalink
Deprecate capacity and is_empty
Browse files Browse the repository at this point in the history
These functions always return the same value so are not useful and
actually calling them is a red flag.
  • Loading branch information
Kixunil committed Oct 31, 2023
1 parent 902150c commit 7dac91d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ecdsa/serialized_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl SerializedSignature {
}

/// Get the capacity of the underlying data buffer.
#[deprecated = "This always returns 72"]
#[inline]
pub fn capacity(&self) -> usize { self.data.len() }

Expand All @@ -106,6 +107,7 @@ impl SerializedSignature {
pub fn from_signature(sig: &Signature) -> SerializedSignature { sig.serialize_der() }

/// Check if the space is zero.
#[deprecated = "This always returns false"]
#[inline]
pub fn is_empty(&self) -> bool { self.len() == 0 }
}
Expand Down

0 comments on commit 7dac91d

Please sign in to comment.