From 7dac91d973b4fc97e2ca2d0d894b46ec3e686ff3 Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Tue, 31 Oct 2023 14:12:39 +0100 Subject: [PATCH] Deprecate `capacity` and `is_empty` These functions always return the same value so are not useful and actually calling them is a red flag. --- src/ecdsa/serialized_signature.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ecdsa/serialized_signature.rs b/src/ecdsa/serialized_signature.rs index 1b2a65a..bf71ecc 100644 --- a/src/ecdsa/serialized_signature.rs +++ b/src/ecdsa/serialized_signature.rs @@ -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() } @@ -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 } }