Skip to content

Commit 3dda438

Browse files
committed
Fix warnings
1) SECP256k1_BUILD is already set, so setting to Some("") avoids the duplicate warning 2) Misc rust unused warnings in various feature flag combinations
1 parent 082cb08 commit 3dda438

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

secp256k1-zkp-sys/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
.include("depend/secp256k1/include")
3939
.include("depend/secp256k1/src")
4040
.flag_if_supported("-Wno-unused-function") // some ecmult stuff is defined but not used upstream
41-
.define("SECP256K1_BUILD", Some("1"))
41+
.define("SECP256K1_BUILD", Some(""))
4242
.define("ENABLE_MODULE_SURJECTIONPROOF", Some("1"))
4343
.define("ENABLE_MODULE_GENERATOR", Some("1"))
4444
.define("ENABLE_MODULE_RANGEPROOF", Some("1"))

src/zkp/ecdsa_adaptor.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ impl EcdsaAdaptorSignature {
287287
mod tests {
288288
use super::Message;
289289
use super::*;
290-
use rand::{rngs::ThreadRng, thread_rng, RngCore};
291290
use SECP256K1;
291+
#[cfg(not(rust_secp_fuzz))]
292+
use rand::{rngs::ThreadRng, thread_rng, RngCore};
292293

294+
#[cfg(not(rust_secp_fuzz))]
293295
fn test_ecdsa_adaptor_signature_helper(
294296
encrypt: fn(&Message, &SecretKey, &PublicKey, &mut ThreadRng) -> EcdsaAdaptorSignature,
295297
) {

src/zkp/generator.rs

+1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ impl Generator {
177177
///
178178
/// This is `pub(crate)` because generators have a different serialization from regular public keys.
179179
/// As such, certain invariants need to be upheld which is easier if we don't allow users to access the internal representation of generators.
180+
#[cfg(feature = "std")] // for un-used warnings
180181
pub(crate) fn as_inner(&self) -> &ffi::PublicKey {
181182
&self.0
182183
}

src/zkp/tag.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl Tag {
1212
self.0
1313
}
1414

15-
#[cfg(feature = "rand")]
15+
#[cfg(all(feature = "rand", feature = "std"))]
1616
pub(crate) fn as_inner(&self) -> &ffi::Tag {
1717
&self.0
1818
}

0 commit comments

Comments
 (0)