diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-12-19 11:47:48 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-12-30 13:06:25 +1300 |
| commit | 4e2afb0052618ca3d758fffd0cf50559be774391 (patch) | |
| tree | 1d15ea3b8b2c53b1e8f1599578325af3840edc04 /src/libcore/slice.rs | |
| parent | ed8f5039115308ca9d5591126e4d8a77864d4730 (diff) | |
| download | rust-4e2afb0052618ca3d758fffd0cf50559be774391.tar.gz rust-4e2afb0052618ca3d758fffd0cf50559be774391.zip | |
Remove ExprSlice by hacking the compiler
[breaking-change] The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
Diffstat (limited to 'src/libcore/slice.rs')
| -rw-r--r-- | src/libcore/slice.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 26684864c4c..3830a7eb9f6 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -990,7 +990,7 @@ impl<'a, T, P> Iterator<&'a mut [T]> for MutSplits<'a, T, P> where P: FnMut(&T) Some(idx) => { let tmp = mem::replace(&mut self.v, &mut []); let (head, tail) = tmp.split_at_mut(idx); - self.v = tail[mut 1..]; + self.v = tail.slice_from_mut(1); Some(head) } } @@ -1026,7 +1026,7 @@ impl<'a, T, P> DoubleEndedIterator<&'a mut [T]> for MutSplits<'a, T, P> where let tmp = mem::replace(&mut self.v, &mut []); let (head, tail) = tmp.split_at_mut(idx); self.v = head; - Some(tail[mut 1..]) + Some(tail.slice_from_mut(1)) } } } |
