real: add serialization bounds to the Real trait
This commit is contained in:
@@ -20,11 +20,19 @@ pub trait ToFloat {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "fmt")]
|
||||
pub trait RealFeatures: fmt::LowerExp + fmt::Display + fmt::Debug {}
|
||||
#[cfg(not(feature = "fmt"))]
|
||||
|
||||
#[cfg(all(not(feature = "fmt"), not(feature = "serde")))]
|
||||
pub trait RealFeatures {}
|
||||
|
||||
#[cfg(all(not(feature = "fmt"), feature = "serde"))]
|
||||
pub trait RealFeatures: Serialize + for<'a> Deserialize<'a> {}
|
||||
|
||||
#[cfg(all(feature = "fmt", not(feature = "serde")))]
|
||||
pub trait RealFeatures: fmt::LowerExp + fmt::Display + fmt::Debug {}
|
||||
|
||||
#[cfg(all(feature = "fmt", feature = "serde"))]
|
||||
pub trait RealFeatures: fmt::LowerExp + fmt::Display + fmt::Debug + Serialize + for<'a> Deserialize<'a> {}
|
||||
|
||||
/// This exists to allow configuration over # of bits (f32 v.s. f64) as well as
|
||||
/// constraints.
|
||||
pub trait Real:
|
||||
|
Reference in New Issue
Block a user