diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-01-23 10:54:32 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-01-30 10:37:44 -0500 |
| commit | ed82b5a70e0ddeea284addef7762375ae5880672 (patch) | |
| tree | 26e98bf39719ee5c9695ed9847ba3170b249e742 /src/libcore/str | |
| parent | 9070345c0ef6ceb38aced40aee3deee4ca2f8e17 (diff) | |
| download | rust-ed82b5a70e0ddeea284addef7762375ae5880672.tar.gz rust-ed82b5a70e0ddeea284addef7762375ae5880672.zip | |
remove Copy impls from iterators
Diffstat (limited to 'src/libcore/str')
| -rw-r--r-- | src/libcore/str/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 8495a03747e..f545c56a060 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -18,6 +18,7 @@ use self::Searcher::{Naive, TwoWay, TwoWayLong}; +use clone::Clone; use cmp::{self, Eq}; use default::Default; use error::Error; @@ -279,7 +280,7 @@ Section: Iterators /// Iterator for the char (representing *Unicode Scalar Values*) of a string /// /// Created with the method `.chars()`. -#[derive(Clone, Copy)] +#[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Chars<'a> { iter: slice::Iter<'a, u8> @@ -1007,11 +1008,11 @@ fn run_utf8_validation_iterator(iter: &mut slice::Iter<u8>) let whole = iter.as_slice(); loop { // save the current thing we're pointing at. - let old = *iter; + let old = iter.clone(); // restore the iterator we had at the start of this codepoint. macro_rules! err { () => {{ - *iter = old; + *iter = old.clone(); return Err(Utf8Error::InvalidByte(whole.len() - iter.as_slice().len())) }}} |
