From cf811abb92481fc61eaa964a31f6132eeb0ae141 Mon Sep 17 00:00:00 2001 From: Yuri Edward Date: Tue, 19 Oct 2021 14:47:46 +0200 Subject: [PATCH] Added identity() --- src/geometry/scale_construction.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geometry/scale_construction.rs b/src/geometry/scale_construction.rs index 1f2acf03..cade72c2 100644 --- a/src/geometry/scale_construction.rs +++ b/src/geometry/scale_construction.rs @@ -3,7 +3,7 @@ use crate::base::storage::Owned; #[cfg(feature = "arbitrary")] use quickcheck::{Arbitrary, Gen}; -use num::{One, Zero}; +use num::{One}; #[cfg(feature = "rand-no-std")] use rand::{ distributions::{Distribution, Standard}, @@ -33,9 +33,9 @@ impl Scale { #[inline] pub fn identity() -> Scale where - T: Zero, + T: One, { - todo!(); + Scale::from(SVector::from_element(T::one())) } /// Cast the components of `self` to another type. @@ -55,7 +55,7 @@ impl Scale { } } -impl One for Scale { +impl One for Scale { #[inline] fn one() -> Self { Self::identity()