Skip to content

Commit 25bb1a4

Browse files
committed
rename MutableVector::mut_split(at) to MutableVector::mut_split_at(at)
1 parent 61443dc commit 25bb1a4

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/libextra/ringbuf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ impl<T> RingBuf<T> {
207207
// start_index to self.elts.len()
208208
// and then
209209
// 0 to end_index
210-
let (temp, remaining1) = self.elts.mut_split(start_index);
211-
let (remaining2, _) = temp.mut_split(end_index);
210+
let (temp, remaining1) = self.elts.mut_split_at(start_index);
211+
let (remaining2, _) = temp.mut_split_at(end_index);
212212
RingBufMutIterator { remaining1: remaining1,
213213
remaining2: remaining2,
214214
nelts: self.nelts }
215215
} else {
216216
// Items to iterate goes from start_index to end_index:
217-
let (empty, elts) = self.elts.mut_split(0);
217+
let (empty, elts) = self.elts.mut_split_at(0);
218218
let remaining1 = elts.mut_slice(start_index, end_index);
219219
RingBufMutIterator { remaining1: remaining1,
220220
remaining2: empty,

src/librustc/middle/borrowck/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ The current rules could use some correction:
666666
function will fail to compile:
667667
668668
fn mut_shift_ref<'a,T>(x: &mut &'a mut [T]) -> &'a mut T {
669-
// `mut_split` will restrict mutation against *x:
670-
let (head, tail) = (*x).mut_split(1);
669+
// `mut_split_at` will restrict mutation against *x:
670+
let (head, tail) = (*x).mut_split_at(1);
671671
672672
// Hence mutating `*x` yields an error here:
673673
*x = tail;

src/libstd/vec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ pub trait MutableVector<'self, T> {
19951995
* itself) and the second will contain all indices from
19961996
* `mid..len` (excluding the index `len` itself).
19971997
*/
1998-
fn mut_split(self, mid: uint) -> (&'self mut [T],
1998+
fn mut_split_at(self, mid: uint) -> (&'self mut [T],
19991999
&'self mut [T]);
20002000

20012001
/// Reverse the order of elements in a vector, in place
@@ -2052,7 +2052,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
20522052
}
20532053

20542054
#[inline]
2055-
fn mut_split(self, mid: uint) -> (&'self mut [T], &'self mut [T]) {
2055+
fn mut_split_at(self, mid: uint) -> (&'self mut [T], &'self mut [T]) {
20562056
unsafe {
20572057
let len = self.len();
20582058
let self2: &'self mut [T] = cast::transmute_copy(&self);
@@ -2592,7 +2592,7 @@ impl<'self, T> Iterator<&'self mut [T]> for MutChunkIter<'self, T> {
25922592
} else {
25932593
let sz = cmp::min(self.remaining, self.chunk_size);
25942594
let tmp = util::replace(&mut self.v, &mut []);
2595-
let (head, tail) = tmp.mut_split(sz);
2595+
let (head, tail) = tmp.mut_split_at(sz);
25962596
self.v = tail;
25972597
self.remaining -= sz;
25982598
Some(head)
@@ -2620,7 +2620,7 @@ impl<'self, T> DoubleEndedIterator<&'self mut [T]> for MutChunkIter<'self, T> {
26202620
let remainder = self.remaining % self.chunk_size;
26212621
let sz = if remainder != 0 { remainder } else { self.chunk_size };
26222622
let tmp = util::replace(&mut self.v, &mut []);
2623-
let (head, tail) = tmp.mut_split(self.remaining - sz);
2623+
let (head, tail) = tmp.mut_split_at(self.remaining - sz);
26242624
self.v = head;
26252625
self.remaining -= sz;
26262626
Some(tail)
@@ -3898,10 +3898,10 @@ mod tests {
38983898
}
38993899

39003900
#[test]
3901-
fn test_mut_split() {
3901+
fn test_mut_split_at() {
39023902
let mut values = [1u8,2,3,4,5];
39033903
{
3904-
let (left, right) = values.mut_split(2);
3904+
let (left, right) = values.mut_split_at(2);
39053905
assert_eq!(left.slice(0, left.len()), [1, 2]);
39063906
for p in left.mut_iter() {
39073907
*p += 1;

0 commit comments

Comments
 (0)