Merge rust-bitcoin/rust-secp256k1#472: Remove unnecessary instances of must_use

d2c97d43d8 Remove unnecessary instances of must_use (Tobin C. Harding)

Pull request description:

  `Result` is already `must_use`, adding the compiler directive to
  functions that return `Result` is unnecessary.

ACKs for top commit:
  apoelstra:
    ACK d2c97d43d8

Tree-SHA512: 2c9cf38ea1b5b9f9502a99b8840cdc1e5969d07b0bfd284b2abc5f68dfe6dd501a9ce3371572256d2284b4ddcdd86770d760c8e482fbf88646c0e04a43493b65
This commit is contained in:
Andrew Poelstra 2022-07-11 15:18:43 +00:00
commit 6741aa0284
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 0 additions and 6 deletions

View File

@ -273,7 +273,6 @@ impl SecretKey {
/// ///
/// Returns an error if the resulting key would be invalid. /// Returns an error if the resulting key would be invalid.
#[inline] #[inline]
#[must_use = "you forgot to use the tweaked secret key"]
pub fn add_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> { pub fn add_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe { unsafe {
if ffi::secp256k1_ec_seckey_tweak_add( if ffi::secp256k1_ec_seckey_tweak_add(
@ -304,7 +303,6 @@ impl SecretKey {
/// ///
/// Returns an error if the resulting key would be invalid. /// Returns an error if the resulting key would be invalid.
#[inline] #[inline]
#[must_use = "you forgot to use the tweaked secret key"]
pub fn mul_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> { pub fn mul_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe { unsafe {
if ffi::secp256k1_ec_seckey_tweak_mul( if ffi::secp256k1_ec_seckey_tweak_mul(
@ -570,7 +568,6 @@ impl PublicKey {
/// ///
/// Returns an error if the resulting key would be invalid. /// Returns an error if the resulting key would be invalid.
#[inline] #[inline]
#[must_use = "you forgot to use the tweaked public key"]
pub fn add_exp_tweak<C: Verification>( pub fn add_exp_tweak<C: Verification>(
mut self, mut self,
secp: &Secp256k1<C>, secp: &Secp256k1<C>,
@ -607,7 +604,6 @@ impl PublicKey {
/// ///
/// Returns an error if the resulting key would be invalid. /// Returns an error if the resulting key would be invalid.
#[inline] #[inline]
#[must_use = "you forgot to use the tweaked public key"]
pub fn mul_tweak<C: Verification>( pub fn mul_tweak<C: Verification>(
mut self, mut self,
secp: &Secp256k1<C>, secp: &Secp256k1<C>,
@ -977,7 +973,6 @@ impl KeyPair {
/// ``` /// ```
// TODO: Add checked implementation // TODO: Add checked implementation
#[inline] #[inline]
#[must_use = "you forgot to use the tweaked key pair"]
pub fn add_xonly_tweak<C: Verification>( pub fn add_xonly_tweak<C: Verification>(
mut self, mut self,
secp: &Secp256k1<C>, secp: &Secp256k1<C>,
@ -1277,7 +1272,6 @@ impl XOnlyPublicKey {
/// let tweaked = xonly.add_tweak(&secp, &tweak).expect("Improbable to fail with a randomly generated tweak"); /// let tweaked = xonly.add_tweak(&secp, &tweak).expect("Improbable to fail with a randomly generated tweak");
/// # } /// # }
/// ``` /// ```
#[must_use = "you forgot to use the tweaked xonly pubkey"]
pub fn add_tweak<V: Verification>( pub fn add_tweak<V: Verification>(
mut self, mut self,
secp: &Secp256k1<V>, secp: &Secp256k1<V>,