forked from M-Labs/nalgebra
Update to the last Rust
Version of rustc: 0.10-pre (1da2962 2014-01-17 23:41:45 -0800) Iterators were renamed.
This commit is contained in:
parent
096cce413f
commit
197f7ff4d2
@ -6,7 +6,7 @@ use std::num::{Zero, One, Real};
|
||||
use std::rand::Rand;
|
||||
use std::rand;
|
||||
use std::vec;
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::vec::{Items, MutItems};
|
||||
use traits::operations::ApproxEq;
|
||||
use std::iter::FromIterator;
|
||||
use traits::geometry::{Dot, Norm};
|
||||
@ -152,14 +152,14 @@ impl<N> Container for DVec<N> {
|
||||
|
||||
impl<N> Iterable<N> for DVec<N> {
|
||||
#[inline]
|
||||
fn iter<'l>(&'l self) -> VecIterator<'l, N> {
|
||||
fn iter<'l>(&'l self) -> Items<'l, N> {
|
||||
self.at.iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl<N> IterableMut<N> for DVec<N> {
|
||||
#[inline]
|
||||
fn mut_iter<'l>(&'l mut self) -> VecMutIterator<'l, N> {
|
||||
fn mut_iter<'l>(&'l mut self) -> MutItems<'l, N> {
|
||||
self.at.mut_iter()
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
use std::cast;
|
||||
use std::num::{One, Zero};
|
||||
use traits::operations::ApproxEq;
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::vec::{Items, MutItems};
|
||||
use structs::vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6, Vec1MulRhs, Vec4MulRhs,
|
||||
Vec5MulRhs, Vec6MulRhs};
|
||||
|
||||
|
@ -124,7 +124,7 @@ macro_rules! iterable_impl(
|
||||
($t: ident, $dim: expr) => (
|
||||
impl<N> Iterable<N> for $t<N> {
|
||||
#[inline]
|
||||
fn iter<'l>(&'l self) -> VecIterator<'l, N> {
|
||||
fn iter<'l>(&'l self) -> Items<'l, N> {
|
||||
unsafe {
|
||||
cast::transmute::<&'l $t<N>, &'l [N, ..$dim * $dim]>(self).iter()
|
||||
}
|
||||
@ -137,7 +137,7 @@ macro_rules! iterable_mut_impl(
|
||||
($t: ident, $dim: expr) => (
|
||||
impl<N> IterableMut<N> for $t<N> {
|
||||
#[inline]
|
||||
fn mut_iter<'l>(&'l mut self) -> VecMutIterator<'l, N> {
|
||||
fn mut_iter<'l>(&'l mut self) -> MutItems<'l, N> {
|
||||
unsafe {
|
||||
cast::transmute::<&'l mut $t<N>, &'l mut [N, ..$dim * $dim]>(self).mut_iter()
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::cast;
|
||||
use std::num::{Zero, One, Real, Bounded};
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::vec::{Items, MutItems};
|
||||
use std::iter::{Iterator, FromIterator};
|
||||
use traits::operations::ApproxEq;
|
||||
use traits::structure::{Iterable, IterableMut, Indexable, Basis, Dim};
|
||||
@ -49,14 +49,14 @@ impl<N> vec::Vec0<N> {
|
||||
|
||||
impl<N> Iterable<N> for vec::Vec0<N> {
|
||||
#[inline]
|
||||
fn iter<'l>(&'l self) -> VecIterator<'l, N> {
|
||||
fn iter<'l>(&'l self) -> Items<'l, N> {
|
||||
unsafe { cast::transmute::<&'l vec::Vec0<N>, &'l [N, ..0]>(self).iter() }
|
||||
}
|
||||
}
|
||||
|
||||
impl<N> IterableMut<N> for vec::Vec0<N> {
|
||||
#[inline]
|
||||
fn mut_iter<'l>(&'l mut self) -> VecMutIterator<'l, N> {
|
||||
fn mut_iter<'l>(&'l mut self) -> MutItems<'l, N> {
|
||||
unsafe { cast::transmute::<&'l mut vec::Vec0<N>, &'l mut [N, ..0]>(self).mut_iter() }
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
use std::cast;
|
||||
use std::num::{Zero, One, Real, Bounded};
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::vec::{Items, MutItems};
|
||||
use std::iter::{Iterator, FromIterator};
|
||||
use traits::operations::ApproxEq;
|
||||
|
||||
|
@ -177,7 +177,7 @@ macro_rules! iterable_impl(
|
||||
($t: ident, $dim: expr) => (
|
||||
impl<N> Iterable<N> for $t<N> {
|
||||
#[inline]
|
||||
fn iter<'l>(&'l self) -> VecIterator<'l, N> {
|
||||
fn iter<'l>(&'l self) -> Items<'l, N> {
|
||||
unsafe {
|
||||
cast::transmute::<&'l $t<N>, &'l [N, ..$dim]>(self).iter()
|
||||
}
|
||||
@ -190,7 +190,7 @@ macro_rules! iterable_mut_impl(
|
||||
($t: ident, $dim: expr) => (
|
||||
impl<N> IterableMut<N> for $t<N> {
|
||||
#[inline]
|
||||
fn mut_iter<'l>(&'l mut self) -> VecMutIterator<'l, N> {
|
||||
fn mut_iter<'l>(&'l mut self) -> MutItems<'l, N> {
|
||||
unsafe {
|
||||
cast::transmute::<&'l mut $t<N>, &'l mut [N, ..$dim]>(self).mut_iter()
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Traits giving structural informations on linear algebra objects or the space they live in.
|
||||
|
||||
use std::num::{Zero, Bounded};
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::vec::{Items, MutItems};
|
||||
use traits::operations::{RMul, LMul, ScalarAdd, ScalarSub};
|
||||
use traits::geometry::{Dot, Norm, UniformSphereSample};
|
||||
|
||||
@ -129,7 +129,7 @@ pub trait Indexable<Index, Res> {
|
||||
/// Traits of objects which can be iterated through like a vector.
|
||||
pub trait Iterable<N> {
|
||||
/// Gets a vector-like read-only iterator.
|
||||
fn iter<'l>(&'l self) -> VecIterator<'l, N>;
|
||||
fn iter<'l>(&'l self) -> Items<'l, N>;
|
||||
}
|
||||
|
||||
/// This is a workaround of current Rust limitations.
|
||||
@ -137,5 +137,5 @@ pub trait Iterable<N> {
|
||||
/// Traits of mutable objects which can be iterated through like a vector.
|
||||
pub trait IterableMut<N> {
|
||||
/// Gets a vector-like read-write iterator.
|
||||
fn mut_iter<'l>(&'l mut self) -> VecMutIterator<'l, N>;
|
||||
fn mut_iter<'l>(&'l mut self) -> MutItems<'l, N>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user