From 92c26334ec67a307fdf369270a0dc1d214408517 Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Fri, 2 Jul 2021 12:01:01 +0200 Subject: [PATCH] Fix serde impls and Distribution impl for OPoint --- src/geometry/point.rs | 4 +++- src/geometry/point_construction.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/geometry/point.rs b/src/geometry/point.rs index dfbd2f88..e65bc535 100644 --- a/src/geometry/point.rs +++ b/src/geometry/point.rs @@ -85,6 +85,7 @@ where impl Serialize for OPoint where DefaultAllocator: Allocator, + >::Buffer: Serialize { fn serialize(&self, serializer: S) -> Result where @@ -98,12 +99,13 @@ where impl<'a, T: Scalar + Deserialize<'a>, D: DimName> Deserialize<'a> for OPoint where DefaultAllocator: Allocator, + >::Buffer: Deserialize<'a> { fn deserialize(deserializer: Des) -> Result where Des: Deserializer<'a>, { - let coords = SVector::::deserialize(deserializer)?; + let coords = OVector::::deserialize(deserializer)?; Ok(Self::from(coords)) } diff --git a/src/geometry/point_construction.rs b/src/geometry/point_construction.rs index 03f24cdb..0ffbf4d8 100644 --- a/src/geometry/point_construction.rs +++ b/src/geometry/point_construction.rs @@ -168,7 +168,7 @@ where /// Generate a `Point` where each coordinate is an independent variate from `[0, 1)`. #[inline] fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> OPoint { - Point::from(rng.gen::>()) + OPoint::from(rng.gen::>()) } }