Skip to content

Commit 5433231

Browse files
committed
---
yaml --- r: 21807 b: refs/heads/snap-stage3 c: 109055c h: refs/heads/master i: 21805: 1b50eb1 21803: cfeacaf 21799: 2f20e00 21791: 73f62dc v: v3
1 parent 3d894be commit 5433231

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7e5661214ad3cc00d40a993cf93b08f8db5d8cac
4+
refs/heads/snap-stage3: 109055c7d3831f0a5a771e6f946e876dd8434223
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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)