Skip to content

Commit

Permalink
Remove unnecessary instances of must_use
Browse files Browse the repository at this point in the history
`Result` is already `must_use`, adding the compiler directive to
functions that return `Result` is unnecessary.
  • Loading branch information
tcharding committed Jul 10, 2022
1 parent 3f99ae8 commit d2c97d4
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 d2c97d4

Please # to comment.