From 42de876e01071e0992067b88c620667be5b1391b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 10 Jun 2022 12:44:04 +1000 Subject: [PATCH] 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. --- src/context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.rs b/src/context.rs index a1f849c..12afb0f 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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 { #[cfg(target_arch = "wasm32")] ffi::types::sanity_checks_for_wasm();