From f8cfd2480b69a1cc266fc91d0b60c825a9dc18a7 Mon Sep 17 00:00:00 2001 From: Florian Wilkens Date: Fri, 19 Dec 2014 21:52:10 +0100 Subject: Renaming of the Iter types as in RFC #344 libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut This is of course a [breaking-change]. --- src/libsyntax/ast_map/mod.rs | 4 ++-- src/libsyntax/ext/deriving/generic/mod.rs | 2 +- src/libsyntax/owned_slice.rs | 2 +- src/libsyntax/util/small_vector.rs | 18 +++++++++--------- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index a95c9e19906..c8c7297f790 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -73,9 +73,9 @@ impl<'a> Iterator for LinkedPath<'a> { } } -// HACK(eddyb) move this into libstd (value wrapper for slice::Items). +// HACK(eddyb) move this into libstd (value wrapper for slice::Iter). #[deriving(Clone)] -pub struct Values<'a, T:'a>(pub slice::Items<'a, T>); +pub struct Values<'a, T:'a>(pub slice::Iter<'a, T>); impl<'a, T: Copy> Iterator for Values<'a, T> { fn next(&mut self) -> Option { diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index d8de3d2db97..2f06271d8de 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -766,7 +766,7 @@ impl<'a> MethodDef<'a> { let fields = if raw_fields.len() > 0 { let mut raw_fields = raw_fields.into_iter().map(|v| v.into_iter()); let first_field = raw_fields.next().unwrap(); - let mut other_fields: Vec, P)>> + let mut other_fields: Vec, P)>> = raw_fields.collect(); first_field.map(|(span, opt_id, field)| { FieldInfo { diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index 8e418e46921..3023c547fb0 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -45,7 +45,7 @@ impl OwnedSlice { &*self.data } - pub fn move_iter(self) -> vec::MoveItems { + pub fn move_iter(self) -> vec::IntoIter { self.into_vec().into_iter() } diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 8d050e34abf..946181770c8 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. use self::SmallVectorRepr::*; -use self::MoveItemsRepr::*; +use self::IntoIterRepr::*; use std::mem; use std::slice; @@ -111,17 +111,17 @@ impl SmallVector { /// Deprecated: use `into_iter`. #[deprecated = "use into_iter"] - pub fn move_iter(self) -> MoveItems { + pub fn move_iter(self) -> IntoIter { self.into_iter() } - pub fn into_iter(self) -> MoveItems { + pub fn into_iter(self) -> IntoIter { let repr = match self.repr { Zero => ZeroIterator, One(v) => OneIterator(v), Many(vs) => ManyIterator(vs.into_iter()) }; - MoveItems { repr: repr } + IntoIter { repr: repr } } pub fn len(&self) -> uint { @@ -135,17 +135,17 @@ impl SmallVector { pub fn is_empty(&self) -> bool { self.len() == 0 } } -pub struct MoveItems { - repr: MoveItemsRepr, +pub struct IntoIter { + repr: IntoIterRepr, } -enum MoveItemsRepr { +enum IntoIterRepr { ZeroIterator, OneIterator(T), - ManyIterator(vec::MoveItems), + ManyIterator(vec::IntoIter), } -impl Iterator for MoveItems { +impl Iterator for IntoIter { fn next(&mut self) -> Option { match self.repr { ZeroIterator => None, -- cgit 1.4.1-3-g733a5