#![warn(missing_docs)]
use rand::SeedableRng;
pub mod constants;
pub mod values;
#[macro_use]
pub mod error;
pub mod format;
pub use format::Format;
#[cfg(feature = "fasta")]
pub use format::fasta::Fasta;
#[cfg(feature = "fastq")]
pub use format::fastq::Fastq;
#[cfg(feature = "vcf")]
pub use format::vcf::Vcf;
#[cfg(feature = "sequence")]
pub use format::sequence::Sequence;
#[cfg(feature = "quality")]
pub use format::quality::Quality;
pub fn rand() -> rand::rngs::StdRng {
rand::rngs::StdRng::from_seed(constants::SEED)
}
pub fn seeded_rand(seed: u64) -> rand::rngs::StdRng {
rand::rngs::StdRng::seed_from_u64(seed)
}
#[cfg(test)]
mod tests {
use rand::Rng;
use super::*;
#[test]
fn check_rand() {
let mut rng = rand();
assert_eq!(rng.gen::<u8>(), 27);
}
#[test]
fn check_seeded_rand() {
let mut rng = seeded_rand(42);
assert_eq!(rng.gen::<u8>(), 162);
}
}