]> git.proxmox.com Git - cargo.git/blobdiff - vendor/rand/src/distributions/float.rs
New upstream version 0.52.0
[cargo.git] / vendor / rand / src / distributions / float.rs
index 0a45f397743cf11c5ca43a86a20839f4528dd40a..733a40394ddab3045b6bffe634acc1c4327c8b1a 100644 (file)
@@ -14,6 +14,9 @@ use crate::Rng;
 use core::mem;
 #[cfg(feature = "simd_support")] use packed_simd::*;
 
+#[cfg(feature = "serde1")]
+use serde::{Serialize, Deserialize};
+
 /// A distribution to sample floating point numbers uniformly in the half-open
 /// interval `(0, 1]`, i.e. including 1 but not 0.
 ///
@@ -39,6 +42,7 @@ use core::mem;
 /// [`Open01`]: crate::distributions::Open01
 /// [`Uniform`]: crate::distributions::uniform::Uniform
 #[derive(Clone, Copy, Debug)]
+#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
 pub struct OpenClosed01;
 
 /// A distribution to sample floating point numbers uniformly in the open
@@ -65,6 +69,7 @@ pub struct OpenClosed01;
 /// [`OpenClosed01`]: crate::distributions::OpenClosed01
 /// [`Uniform`]: crate::distributions::uniform::Uniform
 #[derive(Clone, Copy, Debug)]
+#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
 pub struct Open01;