diff --git a/necsim/impls/no-std/src/cogs/rng/seahash.rs b/necsim/impls/no-std/src/cogs/rng/seahash.rs index 1da7d2e9a..93cc87ecd 100644 --- a/necsim/impls/no-std/src/cogs/rng/seahash.rs +++ b/necsim/impls/no-std/src/cogs/rng/seahash.rs @@ -1,6 +1,6 @@ use core::marker::PhantomData; -use necsim_core::cogs::{MathsCore, PrimeableRng, RngCore}; +use necsim_core::cogs::{Backup, MathsCore, PrimeableRng, RngCore}; use serde::{Deserialize, Serialize}; @@ -17,6 +17,13 @@ pub struct SeaHash { marker: PhantomData, } +#[contract_trait] +impl Backup for SeaHash { + unsafe fn backup_unchecked(&self) -> Self { + self.clone() + } +} + impl RngCore for SeaHash { type Seed = [u8; 8]; diff --git a/necsim/impls/no-std/src/cogs/rng/wyhash.rs b/necsim/impls/no-std/src/cogs/rng/wyhash.rs index eae21264c..c4fdeed68 100644 --- a/necsim/impls/no-std/src/cogs/rng/wyhash.rs +++ b/necsim/impls/no-std/src/cogs/rng/wyhash.rs @@ -1,6 +1,6 @@ use core::marker::PhantomData; -use necsim_core::cogs::{MathsCore, PrimeableRng, RngCore}; +use necsim_core::cogs::{Backup, MathsCore, PrimeableRng, RngCore}; use serde::{Deserialize, Serialize}; @@ -23,6 +23,13 @@ pub struct WyHash { marker: PhantomData, } +#[contract_trait] +impl Backup for WyHash { + unsafe fn backup_unchecked(&self) -> Self { + self.clone() + } +} + impl RngCore for WyHash { type Seed = [u8; 8];