Deprecate `capacity` and `is_empty`

These functions always return the same value so are not useful and
actually calling them is a red flag.
This commit is contained in:
Martin Habovstiak 2023-10-31 14:12:39 +01:00
parent 902150cc7c
commit 7dac91d973
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,7 @@ impl SerializedSignature {
} }
/// Get the capacity of the underlying data buffer. /// Get the capacity of the underlying data buffer.
#[deprecated = "This always returns 72"]
#[inline] #[inline]
pub fn capacity(&self) -> usize { self.data.len() } pub fn capacity(&self) -> usize { self.data.len() }
@ -106,6 +107,7 @@ impl SerializedSignature {
pub fn from_signature(sig: &Signature) -> SerializedSignature { sig.serialize_der() } pub fn from_signature(sig: &Signature) -> SerializedSignature { sig.serialize_der() }
/// Check if the space is zero. /// Check if the space is zero.
#[deprecated = "This always returns false"]
#[inline] #[inline]
pub fn is_empty(&self) -> bool { self.len() == 0 } pub fn is_empty(&self) -> bool { self.len() == 0 }
} }