Rename std::slice::Items -> std::slice::Iter

This commit is contained in:
Pierre Krieger 2014-12-23 19:01:49 +01:00
parent 8a291b8cce
commit 7bfad8e118
10 changed files with 17 additions and 17 deletions

View File

@ -4,7 +4,7 @@
use std::rand::Rand;
use std::rand;
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use std::iter::FromIterator;
use traits::operations::{ApproxEq, Axpy};
use traits::geometry::{Dot, Norm};

View File

@ -110,14 +110,14 @@ macro_rules! dvec_impl(
impl<N> Iterable<N> for $dvec<N> {
#[inline]
fn iter<'l>(&'l self) -> Items<'l, N> {
fn iter<'l>(&'l self) -> Iter<'l, N> {
self.as_slice().iter()
}
}
impl<N> IterableMut<N> for $dvec<N> {
#[inline]
fn iter_mut<'l>(&'l mut self) -> MutItems<'l, N> {
fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N> {
self.as_mut_slice().iter_mut()
}
}

View File

@ -4,7 +4,7 @@
use std::mem;
use traits::operations::ApproxEq;
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use structs::vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6};
use structs::pnt::{Pnt1, Pnt4, Pnt5, Pnt6};
use structs::dvec::{DVec1, DVec2, DVec3, DVec4, DVec5, DVec6};

View File

@ -181,7 +181,7 @@ macro_rules! iterable_impl(
($t: ident, $dim: expr) => (
impl<N> Iterable<N> for $t<N> {
#[inline]
fn iter<'l>(&'l self) -> Items<'l, N> {
fn iter<'l>(&'l self) -> Iter<'l, N> {
unsafe {
mem::transmute::<&'l $t<N>, &'l [N, ..$dim * $dim]>(self).iter()
}
@ -194,7 +194,7 @@ macro_rules! iterable_mut_impl(
($t: ident, $dim: expr) => (
impl<N> IterableMut<N> for $t<N> {
#[inline]
fn iter_mut<'l>(&'l mut self) -> MutItems<'l, N> {
fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N> {
unsafe {
mem::transmute::<&'l mut $t<N>, &'l mut [N, ..$dim * $dim]>(self).iter_mut()
}

View File

@ -3,7 +3,7 @@
#![allow(missing_docs)] // we allow missing to avoid having to document the point components.
use std::mem;
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use std::iter::{Iterator, FromIterator};
use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv};

View File

@ -5,7 +5,7 @@
use std::mem;
use std::num;
use std::rand::{Rand, Rng};
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use structs::{Vec3, Pnt3, Rot3, Mat3};
use traits::operations::{ApproxEq, Inv, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv};

View File

@ -1,5 +1,5 @@
use std::mem;
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use std::iter::{Iterator, FromIterator};
use traits::operations::ApproxEq;
use traits::structure::{Iterable, IterableMut, Indexable, Basis, Dim, Shape, BaseFloat, BaseNum,
@ -66,14 +66,14 @@ impl<N> Indexable<uint, N> for vec::Vec0<N> {
impl<N: 'static> Iterable<N> for vec::Vec0<N> {
#[inline]
fn iter<'l>(&'l self) -> Items<'l, N> {
fn iter<'l>(&'l self) -> Iter<'l, N> {
unsafe { mem::transmute::<&'l vec::Vec0<N>, &'l [N, ..0]>(self).iter() }
}
}
impl<N: 'static> IterableMut<N> for vec::Vec0<N> {
#[inline]
fn iter_mut<'l>(&'l mut self) -> MutItems<'l, N> {
fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N> {
unsafe { mem::transmute::<&'l mut vec::Vec0<N>, &'l mut [N, ..0]>(self).iter_mut() }
}
}

View File

@ -3,7 +3,7 @@
#![allow(missing_docs)] // we allow missing to avoid having to document the dispatch traits.
use std::mem;
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use std::iter::{Iterator, FromIterator};
use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv, Absolute};

View File

@ -269,7 +269,7 @@ macro_rules! iterable_impl(
($t: ident, $dim: expr) => (
impl<N> Iterable<N> for $t<N> {
#[inline]
fn iter<'l>(&'l self) -> Items<'l, N> {
fn iter<'l>(&'l self) -> Iter<'l, N> {
unsafe {
mem::transmute::<&'l $t<N>, &'l [N, ..$dim]>(self).iter()
}
@ -282,7 +282,7 @@ macro_rules! iterable_mut_impl(
($t: ident, $dim: expr) => (
impl<N> IterableMut<N> for $t<N> {
#[inline]
fn iter_mut<'l>(&'l mut self) -> MutItems<'l, N> {
fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N> {
unsafe {
mem::transmute::<&'l mut $t<N>, &'l mut [N, ..$dim]>(self).iter_mut()
}

View File

@ -3,7 +3,7 @@
use std::f32;
use std::f64;
use std::num::{Int, Float, FloatMath};
use std::slice::{Items, MutItems};
use std::slice::{Iter, IterMut};
use traits::operations::{RMul, LMul, Axpy, Transpose, Inv, Absolute};
use traits::geometry::{Dot, Norm, Orig};
@ -209,7 +209,7 @@ pub trait Indexable<I, Res>: Shape<I, Res> + IndexMut<I, 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) -> Items<'l, N>;
fn iter<'l>(&'l self) -> Iter<'l, N>;
}
/// This is a workaround of current Rust limitations.
@ -217,7 +217,7 @@ 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 iter_mut<'l>(&'l mut self) -> MutItems<'l, N>;
fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N>;
}
/*