1
Fork 0

Rename iterators for consistency

Rename existing iterators to get rid of the Iterator suffix and to
give them names that better describe the things being iterated over.
This commit is contained in:
Palmer Cox 2014-01-14 22:32:24 -05:00
parent c58d2bacb7
commit 3fd8c8b330
30 changed files with 476 additions and 477 deletions

View file

@ -36,8 +36,8 @@ impl<T:Ord> Mutable for PriorityQueue<T> {
impl<T:Ord> PriorityQueue<T> {
/// An iterator visiting all values in underlying vector, in
/// arbitrary order.
pub fn iter<'a>(&'a self) -> PriorityQueueIterator<'a, T> {
PriorityQueueIterator { iter: self.data.iter() }
pub fn iter<'a>(&'a self) -> Items<'a, T> {
Items { iter: self.data.iter() }
}
/// Returns the greatest item in the queue - fails if empty
@ -177,11 +177,11 @@ impl<T:Ord> PriorityQueue<T> {
}
/// PriorityQueue iterator
pub struct PriorityQueueIterator <'a, T> {
priv iter: vec::VecIterator<'a, T>,
pub struct Items <'a, T> {
priv iter: vec::Items<'a, T>,
}
impl<'a, T> Iterator<&'a T> for PriorityQueueIterator<'a, T> {
impl<'a, T> Iterator<&'a T> for Items<'a, T> {
#[inline]
fn next(&mut self) -> Option<(&'a T)> { self.iter.next() }