Skip to content

Commit 1c77bf4

Browse files
committed
Add const-generics feature
1 parent c507049 commit 1c77bf4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ travis-ci = { repository = "dalek-cryptography/subtle", branch = "master"}
2828
rand = { version = "0.7" }
2929

3030
[features]
31+
const-generics = []
3132
core_hint_black_box = []
3233
default = ["std", "i128"]
3334
std = []

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cargo-fuzz = true
1010

1111
[dependencies.subtle]
1212
path = ".."
13-
features = ["nightly"]
13+
features = ["nightly", "const-generics"]
1414
[dependencies.libfuzzer-sys]
1515
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
1616

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,10 @@ impl ConditionallySelectable for Choice {
539539
}
540540
}
541541

542+
#[cfg(feature = "const-generics")]
542543
impl<T, const N: usize> ConditionallySelectable for [T; N]
543-
where T: ConditionallySelectable
544+
where
545+
T: ConditionallySelectable,
544546
{
545547
#[inline]
546548
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self {

0 commit comments

Comments
 (0)