summaryrefslogtreecommitdiff
path: root/rand/rand_xoshiro/src/xoshiro512plus.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rand/rand_xoshiro/src/xoshiro512plus.rs')
-rw-r--r--rand/rand_xoshiro/src/xoshiro512plus.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/rand/rand_xoshiro/src/xoshiro512plus.rs b/rand/rand_xoshiro/src/xoshiro512plus.rs
index fe982e4..4b589f2 100644
--- a/rand/rand_xoshiro/src/xoshiro512plus.rs
+++ b/rand/rand_xoshiro/src/xoshiro512plus.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.
///
@@ -22,6 +23,7 @@ use Seed512;
/// reference source code](http://xoshiro.di.unimi.it/xoshiro512plus.c) by
/// David Blackman and Sebastiano Vigna.
#[derive(Debug, Clone)]
+#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))]
pub struct Xoshiro512Plus {
s: [u64; 8],
}
@@ -33,10 +35,7 @@ impl Xoshiro512Plus {
/// parallel computations.
///
/// ```
- /// # extern crate rand;
- /// # extern crate rand_xoshiro;
- /// # fn main() {
- /// use rand::SeedableRng;
+ /// use rand_xoshiro::rand_core::SeedableRng;
/// use rand_xoshiro::Xoshiro512Plus;
///
/// let rng1 = Xoshiro512Plus::seed_from_u64(0);
@@ -44,7 +43,6 @@ impl Xoshiro512Plus {
/// rng2.jump();
/// let mut rng3 = rng2.clone();
/// rng3.jump();
- /// # }
/// ```
pub fn jump(&mut self) {
impl_jump!(u64, self, [