Allow let_and_return for feature guarded code

Clippy emits:

  warning: returning the result of a `let` binding from a block

This is due to feature guarded code, add 'allow' attribute. Use
`cfg_attr` to restrict the allow to when it is needed. Add the already
present `unused_mut` inside the `cfg_attr` guard also.
This commit is contained in:
Tobin C. Harding 2022-06-10 12:44:04 +10:00
parent d64132cd4b
commit 42de876e01
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ mod alloc_only {
/// ctx.seeded_randomize(&seed);
/// # }
/// ```
#[allow(unused_mut)] // Unused when `rand-std` is not enabled.
#[cfg_attr(not(feature = "rand-std"), allow(clippy::let_and_return, unused_mut))]
pub fn gen_new() -> Secp256k1<C> {
#[cfg(target_arch = "wasm32")]
ffi::types::sanity_checks_for_wasm();