Skip to content

Commit

Permalink
Merge #472: Remove unnecessary instances of must_use
Browse files Browse the repository at this point in the history
d2c97d4 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 d2c97d4

Tree-SHA512: 2c9cf38ea1b5b9f9502a99b8840cdc1e5969d07b0bfd284b2abc5f68dfe6dd501a9ce3371572256d2284b4ddcdd86770d760c8e482fbf88646c0e04a43493b65
  • Loading branch information
apoelstra committed Jul 11, 2022
2 parents 3f99ae8 + d2c97d4 commit 6741aa0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ impl SecretKey {
///
/// Returns an error if the resulting key would be invalid.
#[inline]
#[must_use = "you forgot to use the tweaked secret key"]
pub fn add_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe {
if ffi::secp256k1_ec_seckey_tweak_add(
Expand Down Expand Up @@ -304,7 +303,6 @@ impl SecretKey {
///
/// Returns an error if the resulting key would be invalid.
#[inline]
#[must_use = "you forgot to use the tweaked secret key"]
pub fn mul_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe {
if ffi::secp256k1_ec_seckey_tweak_mul(
Expand Down Expand Up @@ -570,7 +568,6 @@ impl PublicKey {
///
/// Returns an error if the resulting key would be invalid.
#[inline]
#[must_use = "you forgot to use the tweaked public key"]
pub fn add_exp_tweak<C: Verification>(
mut self,
secp: &Secp256k1<C>,
Expand Down Expand Up @@ -607,7 +604,6 @@ impl PublicKey {
///
/// Returns an error if the resulting key would be invalid.
#[inline]
#[must_use = "you forgot to use the tweaked public key"]
pub fn mul_tweak<C: Verification>(
mut self,
secp: &Secp256k1<C>,
Expand Down Expand Up @@ -977,7 +973,6 @@ impl KeyPair {
/// ```
// TODO: Add checked implementation
#[inline]
#[must_use = "you forgot to use the tweaked key pair"]
pub fn add_xonly_tweak<C: Verification>(
mut self,
secp: &Secp256k1<C>,
Expand Down Expand Up @@ -1277,7 +1272,6 @@ impl XOnlyPublicKey {
/// 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>(
mut self,
secp: &Secp256k1<V>,
Expand Down

0 comments on commit 6741aa0

Please sign in to comment.