Skip to content

Commit 07139c0

Browse files
author
blake2-ppc
committed
---
yaml --- r: 69475 b: refs/heads/auto c: 99490ad h: refs/heads/master i: 69473: 0fea404 69471: 5a06ad0 v: v3
1 parent 0767fee commit 07139c0

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: ae09d95160919f8801caa22e2867e9680e6cb05b
17+
refs/heads/auto: 99490ad5ba61b2ee69c2cdd70c70857eaf0b895f
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libstd/vec.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,23 +2135,19 @@ macro_rules! double_ended_iterator {
21352135
}
21362136
}
21372137

2138-
macro_rules! random_access_iterator {
2139-
(impl $name:ident -> $elem:ty) => {
2140-
impl<'self, T> RandomAccessIterator<$elem> for $name<'self, T> {
2141-
#[inline]
2142-
fn indexable(&self) -> uint {
2143-
let (exact, _) = self.size_hint();
2144-
exact
2145-
}
2138+
impl<'self, T> RandomAccessIterator<&'self T> for VecIterator<'self, T> {
2139+
#[inline]
2140+
fn indexable(&self) -> uint {
2141+
let (exact, _) = self.size_hint();
2142+
exact
2143+
}
21462144

2147-
fn idx(&self, index: uint) -> Option<$elem> {
2148-
unsafe {
2149-
if index < self.indexable() {
2150-
cast::transmute(self.ptr.offset(index))
2151-
} else {
2152-
None
2153-
}
2154-
}
2145+
fn idx(&self, index: uint) -> Option<&'self T> {
2146+
unsafe {
2147+
if index < self.indexable() {
2148+
cast::transmute(self.ptr.offset(index))
2149+
} else {
2150+
None
21552151
}
21562152
}
21572153
}
@@ -2166,7 +2162,6 @@ pub struct VecIterator<'self, T> {
21662162
}
21672163
iterator!{impl VecIterator -> &'self T}
21682164
double_ended_iterator!{impl VecIterator -> &'self T}
2169-
random_access_iterator!{impl VecIterator -> &'self T}
21702165
pub type RevIterator<'self, T> = Invert<VecIterator<'self, T>>;
21712166

21722167
impl<'self, T> Clone for VecIterator<'self, T> {

0 commit comments

Comments
 (0)