File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
branches/try/src/test/run-pass Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: f8f2c7a9537c7f333b242f616aefb75a83860927
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
5
- refs/heads/try: 5a9047b9b3109be22c219519120881189ca6b61d
5
+ refs/heads/try: 10a14d5f04e958918ae3cd3e3a2ef881e5dc0a6d
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change 12
12
// making method calls, but only if there aren't any matches without
13
13
// it.
14
14
15
+ #![ feature( unboxed_closures) ]
15
16
16
17
trait iterable < A > {
17
- fn iterate ( & self , blk: |x : & A | -> bool ) -> bool ;
18
+ fn iterate < F > ( & self , blk : F ) -> bool where F : FnMut ( & A ) -> bool ;
18
19
}
19
20
20
21
impl < ' a , A > iterable < A > for & ' a [ A ] {
21
- fn iterate ( & self , f: |x : & A | -> bool ) -> bool {
22
+ fn iterate < F > ( & self , f : F ) -> bool where F : FnMut ( & A ) -> bool {
22
23
self . iter ( ) . all ( f)
23
24
}
24
25
}
25
26
26
27
impl < A > iterable < A > for Vec < A > {
27
- fn iterate ( & self , f: |x : & A | -> bool ) -> bool {
28
+ fn iterate < F > ( & self , f : F ) -> bool where F : FnMut ( & A ) -> bool {
28
29
self . iter ( ) . all ( f)
29
30
}
30
31
}
You can’t perform that action at this time.
0 commit comments