diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-12-30 21:01:36 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-12-30 21:01:36 +1100 |
| commit | b7832ed0b42a2d6512e3f8d09605986237f02ed5 (patch) | |
| tree | 313e9f72ae737775db85764279a79122f4d8b458 /src/libcollections/enum_set.rs | |
| parent | fea5aa656ff4349f4d3e1fea1447d26986762ae1 (diff) | |
| download | rust-b7832ed0b42a2d6512e3f8d09605986237f02ed5.tar.gz rust-b7832ed0b42a2d6512e3f8d09605986237f02ed5.zip | |
Implement `Clone` for a large number of iterators & other adaptors.
It's useful to be able to save state.
Diffstat (limited to 'src/libcollections/enum_set.rs')
| -rw-r--r-- | src/libcollections/enum_set.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index fd04ce94247..b484fc41ff6 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -213,6 +213,16 @@ pub struct Iter<E> { bits: uint, } +// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +impl<E> Clone for Iter<E> { + fn clone(&self) -> Iter<E> { + Iter { + index: self.index, + bits: self.bits, + } + } +} + impl<E:CLike> Iter<E> { fn new(bits: uint) -> Iter<E> { Iter { index: 0, bits: bits } |
