Skip to content

Commit 8174160

Browse files
emilktkaitchuck
andauthored
Support fixed seed (#131)
Allow default() when there is neither runtime nor compile time rngs. Co-authored-by: Tom Kaitchuck <[email protected]>
1 parent 8eeeabc commit 8174160

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/rust.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
with:
3333
command: test
3434
args: --no-default-features --features compile-time-rng
35+
- name: check fixed-seed
36+
uses: actions-rs/cargo@v1
37+
with:
38+
command: check
39+
args: --no-default-features --features std
3540
- name: check
3641
uses: actions-rs/cargo@v1
3742
with:

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! aHash is not a cryptographically secure hash.
1111
//!
1212
#![cfg_attr(
13-
any(feature = "compile-time-rng", feature = "runtime-rng"),
13+
feature = "std",
1414
doc = r##"
1515
# Example
1616
```

src/random_state.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ impl fmt::Debug for RandomState {
212212
impl RandomState {
213213
/// Use randomly generated keys
214214
#[inline]
215-
#[cfg(any(feature = "compile-time-rng", feature = "runtime-rng"))]
216215
pub fn new() -> RandomState {
217216
let src = get_src();
218217
let fixed = get_fixed_seeds();
@@ -296,7 +295,6 @@ impl RandomState {
296295
}
297296
}
298297

299-
#[cfg(any(feature = "compile-time-rng", feature = "runtime-rng"))]
300298
impl Default for RandomState {
301299
#[inline]
302300
fn default() -> Self {
@@ -313,7 +311,7 @@ impl BuildHasher for RandomState {
313311
/// will generate the same hashes for the same input data.
314312
///
315313
#[cfg_attr(
316-
any(feature = "compile-time-rng", feature = "runtime-rng"),
314+
feature = "std",
317315
doc = r##" # Examples
318316
```
319317
use ahash::{AHasher, RandomState};

0 commit comments

Comments
 (0)