diff --git a/src/array.rs b/src/array.rs index 3940fba..2a480df 100644 --- a/src/array.rs +++ b/src/array.rs @@ -20,10 +20,10 @@ use std::ops::*; use num::PartialOrd; /// An array containing elements of type `Element` -pub trait Array1 where +pub trait Array where // FIXME: Ugly type signatures - blocked by rust-lang/rust#24092 - Self: Index::Element>, - Self: IndexMut::Element>, + Self: Index::Element>, + Self: IndexMut::Element>, { type Element: Copy; @@ -53,10 +53,10 @@ pub trait Array1 where } /// The sum of the elements of the array. - fn sum(self) -> Self::Element where Self::Element: Add::Element>; + fn sum(self) -> Self::Element where Self::Element: Add::Element>; /// The product of the elements of the array. - fn product(self) -> Self::Element where Self::Element: Mul::Element>; + fn product(self) -> Self::Element where Self::Element: Mul::Element>; /// The minimum element of the array. fn min(self) -> Self::Element where Self::Element: PartialOrd; diff --git a/src/matrix.rs b/src/matrix.rs index 8a8ef98..3fc159d 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -27,7 +27,7 @@ use rust_num::traits::cast; use angle::{Rad, sin, cos, sin_cos}; use approx::ApproxEq; -use array::Array1; +use array::Array; use num::{BaseFloat, BaseNum}; use point::{Point, Point3}; use quaternion::Quaternion; @@ -271,9 +271,9 @@ pub trait Matrix where type Element: BaseFloat; /// The row vector of the matrix. - type Row: Array1; + type Row: Array; /// The column vector of the matrix. - type Column: Array1; + type Column: Array; /// The type of the transposed matrix type Transpose: Matrix; @@ -344,7 +344,7 @@ pub trait SquareMatrix where /// This is used to constrain the column and rows to be of the same type in lieu of equality /// constraints being implemented for `where` clauses. Once those are added, this type will /// likely go away. - type ColumnRow: Array1; + type ColumnRow: Array; /// Create a new diagonal matrix using the supplied value. fn from_value(value: Self::Element) -> Self; diff --git a/src/point.rs b/src/point.rs index 5cd3e9d..e5256c9 100644 --- a/src/point.rs +++ b/src/point.rs @@ -24,7 +24,7 @@ use std::ops::*; use rust_num::{One, Zero}; use approx::ApproxEq; -use array::Array1; +use array::Array; use matrix::Matrix; use num::{BaseNum, BaseFloat}; use vector::*; @@ -68,7 +68,7 @@ impl Point3 { /// Specifies the numeric operations for point types. pub trait Point: Copy + Clone where // FIXME: Ugly type signatures - blocked by rust-lang/rust#24092 - Self: Array1::Scalar>, + Self: Array::Scalar>, // FIXME: blocked by rust-lang/rust#20671 // // for<'a, 'b> &'a Self: Add<&'b V, Output = Self>, @@ -130,7 +130,7 @@ pub trait Point: Copy + Clone where fn max(self, p: Self) -> Self; } -impl Array1 for Point2 { +impl Array for Point2 { type Element = S; fn sum(self) -> S { @@ -226,7 +226,7 @@ impl ApproxEq for Point2 { } } -impl Array1 for Point3 { +impl Array for Point3 { type Element = S; fn sum(self) -> S { diff --git a/src/vector.rs b/src/vector.rs index 5a817c6..5861a7f 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -88,7 +88,7 @@ //! //! Several other useful methods are provided as well. Vector fields can be //! accessed using array syntax (i.e. `vector[0] == vector.x`), or by using -//! the methods provided by the [`Array1`](../array/trait.Array1.html) trait. +//! the methods provided by the [`Array`](../array/trait.Array.html) trait. //! This trait also provides a `map()` method for applying arbitrary functions. //! //! The [`Vector`](../trait.Vector.html) trait presents the most general @@ -105,7 +105,7 @@ use rust_num::{NumCast, Zero, One}; use angle::{Rad, atan2, acos}; use approx::ApproxEq; -use array::Array1; +use array::Array; use num::{BaseNum, BaseFloat, PartialOrd}; /// A trait that specifies a range of numeric operations for vectors. Not all @@ -113,7 +113,7 @@ use num::{BaseNum, BaseFloat, PartialOrd}; /// for pragmatic reasons. pub trait Vector: Copy + Clone where // FIXME: Ugly type signatures - blocked by rust-lang/rust#24092 - Self: Array1::Scalar>, + Self: Array::Scalar>, // FIXME: blocked by rust-lang/rust#20671 // // for<'a, 'b> &'a Self: Add<&'b Self, Output = Self>, @@ -239,7 +239,7 @@ macro_rules! vec { } } - impl Array1 for $VectorN { + impl Array for $VectorN { type Element = S; #[inline] fn sum(self) -> S where S: Add { fold!(add, { $(self.$field),+ }) }