File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: 397abb7242b7d2d3e14a3a11b1ec8b5dadeea06f
9
+ refs/heads/dist-snap: da19563dbce08e2a78720010fe458007baa3703a
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -64,6 +64,26 @@ impl<T> Vec<T> {
64
64
xs
65
65
}
66
66
}
67
+
68
+ /**
69
+ * Partitions the vector into two vectors `(A,B)`, where all
70
+ * elements of `A` satisfy `f` and all elements of `B` do not.
71
+ */
72
+ #[ inline]
73
+ pub fn partition ( self , f: |& T | -> bool) -> ( Vec < T > , Vec < T > ) {
74
+ let mut lefts = Vec :: new ( ) ;
75
+ let mut rights = Vec :: new ( ) ;
76
+
77
+ for elt in self . move_iter ( ) {
78
+ if f ( & elt) {
79
+ lefts. push ( elt) ;
80
+ } else {
81
+ rights. push ( elt) ;
82
+ }
83
+ }
84
+
85
+ ( lefts, rights)
86
+ }
67
87
}
68
88
69
89
impl < T : Clone > Vec < T > {
Original file line number Diff line number Diff line change 14
14
15
15
// Make sure functions have proper names
16
16
// debugger:info functions
17
- // check:static void [...] main();
18
- // check:static void [...] some_function();
19
- // check:static void [...] some_other_function();
20
- // check:static void [...] zzz();
17
+ // check:static void limited-debuginfo:: main();
18
+ // check:static void limited-debuginfo:: some_function();
19
+ // check:static void limited-debuginfo:: some_other_function();
20
+ // check:static void limited-debuginfo:: zzz();
21
21
22
22
// debugger:rbreak zzz
23
23
// debugger:run
@@ -49,4 +49,4 @@ fn some_function(a: int, b: int) {
49
49
zzz ( ) ;
50
50
}
51
51
52
- fn some_other_function ( a : int , b : int ) -> bool { true }
52
+ fn some_other_function ( a : int , b : int ) -> bool { true }
You can’t perform that action at this time.
0 commit comments