Skip to content

Commit 42de876

Browse files
committed
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.
1 parent d64132c commit 42de876

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ mod alloc_only {
188188
/// ctx.seeded_randomize(&seed);
189189
/// # }
190190
/// ```
191-
#[allow(unused_mut)] // Unused when `rand-std` is not enabled.
191+
#[cfg_attr(not(feature = "rand-std"), allow(clippy::let_and_return, unused_mut))]
192192
pub fn gen_new() -> Secp256k1<C> {
193193
#[cfg(target_arch = "wasm32")]
194194
ffi::types::sanity_checks_for_wasm();

0 commit comments

Comments
 (0)