diff options
| author | Palmer Cox <p@lmercox.com> | 2014-01-14 22:32:24 -0500 |
|---|---|---|
| committer | Palmer Cox <p@lmercox.com> | 2014-01-18 01:15:15 -0500 |
| commit | 3fd8c8b3306ae33bdc85811aa410ba01967922bc (patch) | |
| tree | 36818b3c2f6f3c6ba8e145f4a1098dcb87f5bb44 /src/libextra/enum_set.rs | |
| parent | c58d2bacb78ed0d2b9c0c0909e56f390b525aabd (diff) | |
| download | rust-3fd8c8b3306ae33bdc85811aa410ba01967922bc.tar.gz rust-3fd8c8b3306ae33bdc85811aa410ba01967922bc.zip | |
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.
Diffstat (limited to 'src/libextra/enum_set.rs')
| -rw-r--r-- | src/libextra/enum_set.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libextra/enum_set.rs b/src/libextra/enum_set.rs index e0461778075..f12da3080aa 100644 --- a/src/libextra/enum_set.rs +++ b/src/libextra/enum_set.rs @@ -77,8 +77,8 @@ impl<E:CLike> EnumSet<E> { } /// Returns an iterator over an EnumSet - pub fn iter(&self) -> EnumSetIterator<E> { - EnumSetIterator::new(self.bits) + pub fn iter(&self) -> Items<E> { + Items::new(self.bits) } } @@ -101,18 +101,18 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> { } /// An iterator over an EnumSet -pub struct EnumSetIterator<E> { +pub struct Items<E> { priv index: uint, priv bits: uint, } -impl<E:CLike> EnumSetIterator<E> { - fn new(bits: uint) -> EnumSetIterator<E> { - EnumSetIterator { index: 0, bits: bits } +impl<E:CLike> Items<E> { + fn new(bits: uint) -> Items<E> { + Items { index: 0, bits: bits } } } -impl<E:CLike> Iterator<E> for EnumSetIterator<E> { +impl<E:CLike> Iterator<E> for Items<E> { fn next(&mut self) -> Option<E> { if (self.bits == 0) { return None; |
