Skip to content

Commit a43b4ca

Browse files
committed
chore: Replace cfg-if crate with std cfg_select! macro
Rust 1.95 stabilized core::cfg_select!, which covers the same conditional-compilation chain that cfg-if provided. Drop the crate dependency and inline the feature dispatch directly.
1 parent dba2452 commit a43b4ca

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/threshold-bls-ffi/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ wasm-bindgen = { version = "0.2.62", optional = true }
2929
# code size when deploying.
3030
console_error_panic_hook = { version = "0.1.7", optional = true }
3131

32-
cfg-if = "1.0"
33-
3432
jni = { version = "0.21.1", optional = true }
3533

3634
[features]

crates/threshold-bls-ffi/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
// add this so that we can be more explicit about unsafe calls inside unsafe functions
22
#![allow(unused_unsafe)]
33

4-
extern crate cfg_if;
5-
6-
cfg_if::cfg_if! {
7-
if #[cfg(feature = "wasm")] {
4+
core::cfg_select! {
5+
feature = "wasm" => {
86
pub mod wasm;
9-
} else if #[cfg(feature = "jni")] {
7+
}
8+
feature = "jni" => {
109
pub mod jni_bridge;
11-
} else if #[cfg(feature = "ffi")] {
10+
}
11+
feature = "ffi" => {
1212
pub mod ffi;
1313
pub(crate) type Signature = <SigScheme as Scheme>::Signature;
1414
pub(crate) const PUBKEY_LEN: usize = 96;
1515
pub(crate) const PRIVKEY_LEN: usize = 32;
1616
}
17+
_ => {}
1718
}
1819

1920
use threshold_bls::{poly::Idx, schemes::bls12_377::G2Scheme as SigScheme, sig::Scheme};

0 commit comments

Comments
 (0)