Skip to content

Commit

Permalink
only allow u64 parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall committed Feb 20, 2025
1 parent 70c1ccd commit 476dc8b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions proptest/src/test_runner/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,7 @@ pub enum RngSeed {
impl std::str::FromStr for RngSeed {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
if s == "random" {
Ok(RngSeed::Random)
} else {
s.parse().map(RngSeed::Fixed).map_err(|_| ())
}
s.parse::<u64>().map(RngSeed::Fixed).map_err(|_| ())
}
}

Expand Down Expand Up @@ -437,7 +433,7 @@ pub struct Config {
pub rng_algorithm: RngAlgorithm,

/// Seed used for the RNG. Set by using the PROPTEST_RNG_SEED environment variable
/// If `random` is supplied, a random seed is generated (this is the default option).
/// If the environment variable is undefined, a random seed is generated (this is the default option).
pub rng_seed: RngSeed,

// Needs to be public so FRU syntax can be used.
Expand Down

0 comments on commit 476dc8b

Please sign in to comment.