Skip to content

Commit 020d053

Browse files
committed
---
yaml --- r: 28493 b: refs/heads/try c: 109055c h: refs/heads/master i: 28491: 802ffc5 v: v3
1 parent 8503d5a commit 020d053

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 7e5661214ad3cc00d40a993cf93b08f8db5d8cac
5+
refs/heads/try: 109055c7d3831f0a5a771e6f946e876dd8434223
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libcore/iter-trait.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ impl<A> IMPL_T<A>: iter::ExtendedIter<A> {
1818
pure fn foldl<B>(+b0: B, blk: fn(B, A) -> B) -> B {
1919
iter::foldl(self, move b0, blk)
2020
}
21+
pure fn position(f: fn(A) -> bool) -> Option<uint> {
22+
iter::position(self, f)
23+
}
2124
}
2225

2326
impl<A: Eq> IMPL_T<A>: iter::EqIter<A> {
2427
pure fn contains(x: A) -> bool { iter::contains(self, x) }
2528
pure fn count(x: A) -> uint { iter::count(self, x) }
26-
pure fn position(f: fn(A) -> bool) -> Option<uint> {
27-
iter::position(self, f)
28-
}
2929
}
3030

3131
impl<A: Copy> IMPL_T<A>: iter::CopyableIter<A> {

branches/try/src/libcore/iter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ trait ExtendedIter<A> {
1313
pure fn all(blk: fn(A) -> bool) -> bool;
1414
pure fn any(blk: fn(A) -> bool) -> bool;
1515
pure fn foldl<B>(+b0: B, blk: fn(B, A) -> B) -> B;
16+
pure fn position(f: fn(A) -> bool) -> Option<uint>;
1617
}
1718

1819
trait EqIter<A:Eq> {
1920
pure fn contains(x: A) -> bool;
2021
pure fn count(x: A) -> uint;
21-
pure fn position(f: fn(A) -> bool) -> Option<uint>;
2222
}
2323

2424
trait Times {
@@ -142,7 +142,8 @@ pure fn count<A:Eq,IA:BaseIter<A>>(self: IA, x: A) -> uint {
142142
}
143143

144144
pure fn position<A,IA:BaseIter<A>>(self: IA, f: fn(A) -> bool)
145-
-> Option<uint> {
145+
-> Option<uint>
146+
{
146147
let mut i = 0;
147148
for self.each |a| {
148149
if f(a) { return Some(i); }

branches/try/src/libcore/vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,14 +2019,14 @@ impl<A> &[A]: iter::ExtendedIter<A> {
20192019
pure fn foldl<B>(+b0: B, blk: fn(B, A) -> B) -> B {
20202020
iter::foldl(self, move b0, blk)
20212021
}
2022+
pure fn position(f: fn(A) -> bool) -> Option<uint> {
2023+
iter::position(self, f)
2024+
}
20222025
}
20232026

20242027
impl<A: Eq> &[A]: iter::EqIter<A> {
20252028
pure fn contains(x: A) -> bool { iter::contains(self, x) }
20262029
pure fn count(x: A) -> uint { iter::count(self, x) }
2027-
pure fn position(f: fn(A) -> bool) -> Option<uint> {
2028-
iter::position(self, f)
2029-
}
20302030
}
20312031

20322032
impl<A: Copy> &[A]: iter::CopyableIter<A> {

0 commit comments

Comments
 (0)