Skip to content

Commit 4e70982

Browse files
committed
refactor: re-export rand/rand_distr from core
1 parent 30edbae commit 4e70982

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

forrustts-core/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ keywords = ["simulation", "tree_sequences", "tskit", "population_genetics"]
1313

1414
[dependencies]
1515
thiserror = "1.0"
16-
# NOTE: automagically adds rand as a cargo feature
17-
rand = { version = "0.8.5", optional = true }
16+
rand = { version = "0.8.5" }
17+
rand_distr = "0.4.3"
1818

1919
[dev-dependencies]
2020
proptest = "1.1.0"

forrustts-core/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#![warn(rustdoc::broken_intra_doc_links)]
55
#![cfg_attr(doc_cfg, feature(doc_cfg))]
66

7+
pub use rand;
8+
pub use rand_distr;
9+
710
use thiserror::Error;
811

912
mod position;
1013
pub mod prelude;
11-
#[cfg(feature = "rand")]
1214
mod rand_position;
1315
mod time;
1416

forrustts-genetics/Cargo.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ keywords = ["simulation", "tree_sequences", "tskit", "population_genetics"]
1212
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1313

1414
[dependencies]
15-
forrustts-core = { version = "0.1.0", path = "../forrustts-core", features = ["rand"]}
16-
rand = "0.8.5"
17-
rand_distr = "0.4.3"
15+
forrustts-core = { version = "0.1.0", path = "../forrustts-core" }

forrustts-genetics/src/genetic_maps.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
use crate::rand::Rng;
2+
use crate::rand_distr;
3+
14
use forrustts_core::Position;
2-
use rand::Rng;
35

46
/// Breakpoint positions from crossover events
57
///

forrustts-genetics/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Core types for genetics
22
3+
use forrustts_core::rand;
4+
use forrustts_core::rand_distr;
5+
36
mod genetic_maps;
47

58
pub use genetic_maps::BernoulliCrossover;

forrustts-genetics/tests/test_genetic_maps.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use forrustts_core::rand;
12
use rand::SeedableRng;
23

34
use forrustts_core::Position;

0 commit comments

Comments
 (0)