From 534ba55d3e4ad06cf7a4ecf9ec996df88e71b13c Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Sat, 12 Dec 2015 23:27:25 +1100 Subject: [PATCH] Remove Vector::one Fixes #270 --- src/vector.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/vector.rs b/src/vector.rs index cee8e41..317b423 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -41,7 +41,6 @@ //! //! assert_eq!(a + b, Vector2::zero()); //! assert_eq!(-(a * b), Vector2::new(9.0f64, 16.0f64)); -//! assert_eq!(a / Vector2::one(), a); //! //! // As with Rust's `int` and `f32` types, Vectors of different types cannot //! // be added and so on with impunity. The following will fail to compile: @@ -126,12 +125,9 @@ pub trait Vector: Copy + Clone where /// Construct a vector from a single value, replicating it. fn from_value(scalar: Self::Scalar) -> Self; - /// The zero vector (with all components set to zero) + /// The additive identity vector. Adding this vector with another has no effect. #[inline] fn zero() -> Self { Self::from_value(Self::Scalar::zero()) } - /// The identity vector (with all components set to one) - #[inline] - fn one() -> Self { Self::from_value(Self::Scalar::one()) } /// Vector dot product fn dot(self, other: Self) -> Self::Scalar;