Skip to content

Commit

Permalink
Allow let_and_return for feature guarded code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tcharding committed Jun 17, 2022
1 parent d64132c commit 42de876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/context.rs
Expand Up @@ -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();
Expand Down

0 comments on commit 42de876

Please sign in to comment.