diff options
Diffstat (limited to 'components/util')
-rw-r--r-- | components/util/bloom.rs | 2 | ||||
-rw-r--r-- | components/util/cache.rs | 2 | ||||
-rw-r--r-- | components/util/smallvec.rs | 28 | ||||
-rw-r--r-- | components/util/sort.rs | 2 | ||||
-rw-r--r-- | components/util/time.rs | 2 | ||||
-rw-r--r-- | components/util/workqueue.rs | 6 |
6 files changed, 21 insertions, 21 deletions
diff --git a/components/util/bloom.rs b/components/util/bloom.rs index 0019092663f..4621697fa50 100644 --- a/components/util/bloom.rs +++ b/components/util/bloom.rs @@ -262,7 +262,7 @@ impl BloomFilter { /// on every element. pub fn clear(&mut self) { self.number_of_insertions = 0; - for x in self.buf.as_mut_slice().mut_iter() { + for x in self.buf.as_mut_slice().iter_mut() { *x = 0u; } } diff --git a/components/util/cache.rs b/components/util/cache.rs index 1b159cea8c1..35d442cd079 100644 --- a/components/util/cache.rs +++ b/components/util/cache.rs @@ -238,7 +238,7 @@ impl<K:Clone+PartialEq+Hash,V:Clone> Cache<K,V> for SimpleHashCache<K,V> { } fn evict_all(&mut self) { - for slot in self.entries.mut_iter() { + for slot in self.entries.iter_mut() { *slot = None } } diff --git a/components/util/smallvec.rs b/components/util/smallvec.rs index ef47103e317..c5a9c87e84c 100644 --- a/components/util/smallvec.rs +++ b/components/util/smallvec.rs @@ -21,12 +21,12 @@ pub trait VecLike<T> { fn vec_len(&self) -> uint; fn vec_push(&mut self, value: T); - fn vec_mut_slice<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T]; + fn vec_slice_mut<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T]; #[inline] - fn vec_mut_slice_from<'a>(&'a mut self, start: uint) -> &'a mut [T] { + fn vec_slice_from_mut<'a>(&'a mut self, start: uint) -> &'a mut [T] { let len = self.vec_len(); - self.vec_mut_slice(start, len) + self.vec_slice_mut(start, len) } } @@ -42,8 +42,8 @@ impl<T> VecLike<T> for Vec<T> { } #[inline] - fn vec_mut_slice<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { - self.mut_slice(start, end) + fn vec_slice_mut<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { + self.slice_mut(start, end) } } @@ -102,7 +102,7 @@ pub trait SmallVec<T> : SmallVecPrivate<T> where T: 'static { /// NB: For efficiency reasons (avoiding making a second copy of the inline elements), this /// actually clears out the original array instead of moving it. - fn move_iter<'a>(&'a mut self) -> SmallVecMoveIterator<'a,T> { + fn into_iter<'a>(&'a mut self) -> SmallVecMoveIterator<'a,T> { unsafe { let iter = mem::transmute(self.iter()); let ptr_opt = if self.spilled() { @@ -136,7 +136,7 @@ pub trait SmallVec<T> : SmallVecPrivate<T> where T: 'static { } fn push_all_move<V:SmallVec<T>>(&mut self, mut other: V) { - for value in other.move_iter() { + for value in other.into_iter() { self.push(value) } } @@ -219,12 +219,12 @@ pub trait SmallVec<T> : SmallVecPrivate<T> where T: 'static { self.slice(0, self.len()) } - fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] { + fn as_slice_mut<'a>(&'a mut self) -> &'a mut [T] { let len = self.len(); - self.mut_slice(0, len) + self.slice_mut(0, len) } - fn mut_slice<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { + fn slice_mut<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { assert!(start <= end); assert!(end <= self.len()); unsafe { @@ -235,9 +235,9 @@ pub trait SmallVec<T> : SmallVecPrivate<T> where T: 'static { } } - fn mut_slice_from<'a>(&'a mut self, start: uint) -> &'a mut [T] { + fn slice_from_mut<'a>(&'a mut self, start: uint) -> &'a mut [T] { let len = self.len(); - self.mut_slice(start, len) + self.slice_mut(start, len) } fn fail_bounds_check(&self, index: uint) { @@ -400,8 +400,8 @@ macro_rules! def_small_vector( } #[inline] - fn vec_mut_slice<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { - self.mut_slice(start, end) + fn vec_slice_mut<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { + self.slice_mut(start, end) } } diff --git a/components/util/sort.rs b/components/util/sort.rs index 32dc52f6574..bf0c37d8ea6 100644 --- a/components/util/sort.rs +++ b/components/util/sort.rs @@ -91,7 +91,7 @@ pub mod test { let len: uint = rng.gen(); let mut v: Vec<int> = rng.gen_iter::<int>().take((len % 32) + 1).collect(); fn compare_ints(a: &int, b: &int) -> Ordering { a.cmp(b) } - sort::quicksort_by(v.as_mut_slice(), compare_ints); + sort::quicksort_by(v.as_slice_mut(), compare_ints); for i in range(0, v.len() - 1) { assert!(v.get(i) <= v.get(i + 1)) } diff --git a/components/util/time.rs b/components/util/time.rs index fd83eb34eb5..d3e9b5df65d 100644 --- a/components/util/time.rs +++ b/components/util/time.rs @@ -210,7 +210,7 @@ impl TimeProfiler { "_category_", "_incremental?_", "_iframe?_", " _url_", " _mean (ms)_", " _median (ms)_", " _min (ms)_", " _max (ms)_", " _events_"); - for (&(ref category, ref meta), ref mut data) in self.buckets.mut_iter() { + for (&(ref category, ref meta), ref mut data) in self.buckets.iter_mut() { data.sort_by(|a, b| { if a < b { Less diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs index 9effab16551..4924036a6a8 100644 --- a/components/util/workqueue.rs +++ b/components/util/workqueue.rs @@ -229,7 +229,7 @@ impl<QueueData: Send, WorkData: Send> WorkQueue<QueueData, WorkData> { } // Spawn threads. - for thread in threads.move_iter() { + for thread in threads.into_iter() { TaskBuilder::new().named(task_name).native().spawn(proc() { let mut thread = thread; thread.start() @@ -260,8 +260,8 @@ impl<QueueData: Send, WorkData: Send> WorkQueue<QueueData, WorkData> { pub fn run(&mut self) { // Tell the workers to start. let mut work_count = AtomicUint::new(self.work_count); - for worker in self.workers.mut_iter() { - worker.chan.send(StartMsg(worker.deque.take_unwrap(), &mut work_count, &self.data)) + for worker in self.workers.iter_mut() { + worker.chan.send(StartMsg(worker.deque.take().unwrap(), &mut work_count, &self.data)) } // Wait for the work to finish. |