aboutsummaryrefslogtreecommitdiff
path: root/rand/rand_xoshiro/src/xoshiro512starstar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rand/rand_xoshiro/src/xoshiro512starstar.rs')
-rw-r--r--rand/rand_xoshiro/src/xoshiro512starstar.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/rand/rand_xoshiro/src/xoshiro512starstar.rs b/rand/rand_xoshiro/src/xoshiro512starstar.rs
index 1a33f0a..2db9ac1 100644
--- a/rand/rand_xoshiro/src/xoshiro512starstar.rs
+++ b/rand/rand_xoshiro/src/xoshiro512starstar.rs
@@ -6,11 +6,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[cfg(feature="serde1")] use serde::{Serialize, Deserialize};
use rand_core::impls::fill_bytes_via_next;
use rand_core::le::read_u64_into;
use rand_core::{SeedableRng, RngCore, Error};
-use Seed512;
+use crate::Seed512;
/// A xoshiro512** random number generator.
///
@@ -21,6 +22,7 @@ use Seed512;
/// reference source code](http://xoshiro.di.unimi.it/xoshiro512starstar.c) by
/// David Blackman and Sebastiano Vigna.
#[derive(Debug, Clone)]
+#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))]
pub struct Xoshiro512StarStar {
s: [u64; 8],
}
@@ -32,10 +34,7 @@ impl Xoshiro512StarStar {
/// parallel computations.
///
/// ```
- /// # extern crate rand;
- /// # extern crate rand_xoshiro;
- /// # fn main() {
- /// use rand::SeedableRng;
+ /// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro512StarStar;
///
/// let rng1 = Xoshiro512StarStar::seed_from_u64(0);
@@ -43,7 +42,6 @@ impl Xoshiro512StarStar {
/// rng2.jump();
/// let mut rng3 = rng2.clone();
/// rng3.jump();
- /// # }
/// ```
pub fn jump(&mut self) {
impl_jump!(u64, self, [