Skip to content

Commit

Permalink
fix build without std/alloc features
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored and vks committed Aug 2, 2020
1 parent a75317e commit 321ae39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rand_distr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ num-traits = { version = "0.2", default-features = false, features = ["libm"] }

[features]
default = ["std"]
std = ["alloc"]
alloc = []
std = ["alloc", "rand/std"]
alloc = ["rand/alloc"]

[dev-dependencies]
rand_pcg = { version = "0.2", path = "../rand_pcg" }
Expand Down
4 changes: 2 additions & 2 deletions rand_distr/src/exponential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ mod test {
#[test]
fn test_zero() {
let d = Exp::new(0.0).unwrap();
assert_eq!(d.sample(&mut crate::test::rng(21)), std::f64::INFINITY);
assert_eq!(d.sample(&mut crate::test::rng(21)), f64::infinity());
}
#[test]
#[should_panic]
Expand All @@ -173,6 +173,6 @@ mod test {
#[test]
#[should_panic]
fn test_exp_invalid_lambda_nan() {
Exp::new(std::f64::NAN).unwrap();
Exp::new(f64::nan()).unwrap();
}
}

0 comments on commit 321ae39

Please sign in to comment.