diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-09-14 20:27:36 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-09-16 14:37:48 -0700 |
| commit | fc525eeb4ec3443d29bce677f589b19f31c189bb (patch) | |
| tree | d807bad5c91171751157a945dde963dcfd4ea95e /src/libcore | |
| parent | d8dfe1957b6541de8fe2797e248fe4bd2fac02d9 (diff) | |
Fallout from renaming
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/fmt/float.rs | 4 | ||||
| -rw-r--r-- | src/libcore/fmt/mod.rs | 2 | ||||
| -rw-r--r-- | src/libcore/fmt/num.rs | 4 | ||||
| -rw-r--r-- | src/libcore/iter.rs | 6 | ||||
| -rw-r--r-- | src/libcore/ptr.rs | 4 | ||||
| -rw-r--r-- | src/libcore/slice.rs | 38 |
6 files changed, 29 insertions, 29 deletions
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index 3a07e43e509..fcc794fd0d1 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -203,7 +203,7 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>( _ => () } - buf.mut_slice_to(end).reverse(); + buf.slice_to_mut(end).reverse(); // Remember start of the fractional digits. // Points one beyond end of buf if none get generated, @@ -342,7 +342,7 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>( impl<'a> fmt::FormatWriter for Filler<'a> { fn write(&mut self, bytes: &[u8]) -> fmt::Result { - slice::bytes::copy_memory(self.buf.mut_slice_from(*self.end), + slice::bytes::copy_memory(self.buf.slice_from_mut(*self.end), bytes); *self.end += bytes.len(); Ok(()) diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index f41d02070c9..7bab59960b0 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -420,7 +420,7 @@ impl<'a> Formatter<'a> { // Writes the sign if it exists, and then the prefix if it was requested let write_prefix = |f: &mut Formatter| { - for c in sign.move_iter() { + for c in sign.into_iter() { let mut b = [0, ..4]; let n = c.encode_utf8(b).unwrap_or(0); try!(f.buf.write(b.slice_to(n))); diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 21cbafdc605..568745d70b3 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -43,7 +43,7 @@ trait GenericRadix { if is_positive { // Accumulate each digit of the number from the least significant // to the most significant figure. - for byte in buf.mut_iter().rev() { + for byte in buf.iter_mut().rev() { let n = x % base; // Get the current place value. x = x / base; // Deaccumulate the number. *byte = self.digit(cast(n).unwrap()); // Store the digit in the buffer. @@ -52,7 +52,7 @@ trait GenericRadix { } } else { // Do the same as above, but accounting for two's complement. - for byte in buf.mut_iter().rev() { + for byte in buf.iter_mut().rev() { let n = -(x % base); // Get the current place value. x = x / base; // Deaccumulate the number. *byte = self.digit(cast(n).unwrap()); // Store the digit in the buffer. diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index cf977a6ebe6..6bee0573fac 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -377,7 +377,7 @@ pub trait Iterator<A> { /// sum /// } /// let x = vec![1i,2,3,7,8,9]; - /// assert_eq!(process(x.move_iter()), 1006); + /// assert_eq!(process(x.into_iter()), 1006); /// ``` #[inline] fn fuse(self) -> Fuse<Self> { @@ -1682,7 +1682,7 @@ impl<'a, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for FlatMap<'a, A, T, #[inline] fn next(&mut self) -> Option<B> { loop { - for inner in self.frontiter.mut_iter() { + for inner in self.frontiter.iter_mut() { for x in *inner { return Some(x) } @@ -1713,7 +1713,7 @@ impl<'a, #[inline] fn next_back(&mut self) -> Option<B> { loop { - for inner in self.backiter.mut_iter() { + for inner in self.backiter.iter_mut() { match inner.next_back() { None => (), y => return y diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 42416a640bf..b76c92140fd 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -124,7 +124,7 @@ pub fn mut_null<T>() -> *mut T { null_mut() } /// ``` /// use std::ptr; /// -/// let p: *mut int = ptr::mut_null(); +/// let p: *mut int = ptr::null_mut(); /// assert!(p.is_null()); /// ``` #[inline] @@ -327,7 +327,7 @@ impl<T> RawPtr<T> for *const T { impl<T> RawPtr<T> for *mut T { #[inline] - fn null() -> *mut T { mut_null() } + fn null() -> *mut T { null_mut() } #[inline] fn is_null(&self) -> bool { *self == RawPtr::null() } diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 05b0c1e4f70..65ad7bb1753 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -583,7 +583,7 @@ pub trait MutableSlice<'a, T> { * ```ignore * if self.len() == 0 { return None; } * let head = &mut self[0]; - * *self = self.mut_slice_from(1); + * *self = self.slice_from_mut(1); * Some(head) * ``` * @@ -602,7 +602,7 @@ pub trait MutableSlice<'a, T> { * ```ignore * if self.len() == 0 { return None; } * let tail = &mut self[self.len() - 1]; - * *self = self.mut_slice_to(self.len() - 1); + * *self = self.slice_to_mut(self.len() - 1); * Some(tail) * ``` * @@ -650,19 +650,19 @@ pub trait MutableSlice<'a, T> { /// /// // scoped to restrict the lifetime of the borrows /// { - /// let (left, right) = v.mut_split_at(0); + /// let (left, right) = v.split_at_mut(0); /// assert!(left == &mut []); /// assert!(right == &mut [1i, 2, 3, 4, 5, 6]); /// } /// /// { - /// let (left, right) = v.mut_split_at(2); + /// let (left, right) = v.split_at_mut(2); /// assert!(left == &mut [1i, 2]); /// assert!(right == &mut [3i, 4, 5, 6]); /// } /// /// { - /// let (left, right) = v.mut_split_at(6); + /// let (left, right) = v.split_at_mut(6); /// assert!(left == &mut [1i, 2, 3, 4, 5, 6]); /// assert!(right == &mut []); /// } @@ -768,12 +768,12 @@ impl<'a,T> MutableSlice<'a, T> for &'a mut [T] { #[inline] fn slice_from_mut(self, start: uint) -> &'a mut [T] { let len = self.len(); - self.mut_slice(start, len) + self.slice_mut(start, len) } #[inline] fn slice_to_mut(self, end: uint) -> &'a mut [T] { - self.mut_slice(0, end) + self.slice_mut(0, end) } #[inline] @@ -781,7 +781,7 @@ impl<'a,T> MutableSlice<'a, T> for &'a mut [T] { unsafe { let len = self.len(); let self2: &'a mut [T] = mem::transmute_copy(&self); - (self.mut_slice(0, mid), self2.mut_slice(mid, len)) + (self.slice_mut(0, mid), self2.slice_mut(mid, len)) } } @@ -861,8 +861,8 @@ impl<'a,T> MutableSlice<'a, T> for &'a mut [T] { while i < ln / 2 { // Unsafe swap to avoid the bounds check in safe swap. unsafe { - let pa: *mut T = self.unsafe_mut_ref(i); - let pb: *mut T = self.unsafe_mut_ref(ln - i - 1); + let pa: *mut T = self.unsafe_mut(i); + let pb: *mut T = self.unsafe_mut(ln - i - 1); ptr::swap(pa, pb); } i += 1; @@ -881,7 +881,7 @@ impl<'a,T> MutableSlice<'a, T> for &'a mut [T] { #[inline] unsafe fn unsafe_set(self, index: uint, val: T) { - *self.unsafe_mut_ref(index) = val; + *self.unsafe_mut(index) = val; } #[inline] @@ -1018,7 +1018,7 @@ pub trait MutableCloneableSlice<T> { impl<'a, T:Clone> MutableCloneableSlice<T> for &'a mut [T] { #[inline] fn clone_from_slice(self, src: &[T]) -> uint { - for (a, b) in self.mut_iter().zip(src.iter()) { + for (a, b) in self.iter_mut().zip(src.iter()) { a.clone_from(b); } cmp::min(self.len(), src.len()) @@ -1274,14 +1274,14 @@ impl<'a, T> Iterator<&'a mut [T]> for MutSplits<'a, T> { self.finished = true; let tmp = mem::replace(&mut self.v, &mut []); let len = tmp.len(); - let (head, tail) = tmp.mut_split_at(len); + let (head, tail) = tmp.split_at_mut(len); self.v = tail; Some(head) } Some(idx) => { let tmp = mem::replace(&mut self.v, &mut []); - let (head, tail) = tmp.mut_split_at(idx); - self.v = tail.mut_slice_from(1); + let (head, tail) = tmp.split_at_mut(idx); + self.v = tail.slice_from_mut(1); Some(head) } } @@ -1314,9 +1314,9 @@ impl<'a, T> DoubleEndedIterator<&'a mut [T]> for MutSplits<'a, T> { } Some(idx) => { let tmp = mem::replace(&mut self.v, &mut []); - let (head, tail) = tmp.mut_split_at(idx); + let (head, tail) = tmp.split_at_mut(idx); self.v = head; - Some(tail.mut_slice_from(1)) + Some(tail.slice_from_mut(1)) } } } @@ -1483,7 +1483,7 @@ impl<'a, T> Iterator<&'a mut [T]> for MutChunks<'a, T> { } else { let sz = cmp::min(self.v.len(), self.chunk_size); let tmp = mem::replace(&mut self.v, &mut []); - let (head, tail) = tmp.mut_split_at(sz); + let (head, tail) = tmp.split_at_mut(sz); self.v = tail; Some(head) } @@ -1512,7 +1512,7 @@ impl<'a, T> DoubleEndedIterator<&'a mut [T]> for MutChunks<'a, T> { let sz = if remainder != 0 { remainder } else { self.chunk_size }; let tmp = mem::replace(&mut self.v, &mut []); let tmp_len = tmp.len(); - let (head, tail) = tmp.mut_split_at(tmp_len - sz); + let (head, tail) = tmp.split_at_mut(tmp_len - sz); self.v = head; Some(tail) } |
