File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 6647a3402bf75368de1a692370c558d423f36940
2
+ refs/heads/master: d903231f1e7d7efb35405bdfdcbc451385e429b2
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5
5
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
Original file line number Diff line number Diff line change 12
12
13
13
use core:: container:: { Container , Mutable } ;
14
14
use core:: cmp:: Ord ;
15
+ use core:: iter:: BaseIter ;
15
16
use core:: prelude:: * ;
16
17
use core:: ptr:: addr_of;
17
18
use core:: vec;
@@ -26,6 +27,14 @@ pub struct PriorityQueue<T> {
26
27
priv data : ~[ T ] ,
27
28
}
28
29
30
+ impl < T : Ord > PriorityQueue < T > : BaseIter < T > {
31
+ /// Visit all values in the underlying vector.
32
+ ///
33
+ /// The values are **not** visited in order.
34
+ pure fn each ( & self , f : fn ( & T ) -> bool ) { self . data . each ( f) }
35
+ pure fn size_hint ( & self ) -> Option < uint > { self . data . size_hint ( ) }
36
+ }
37
+
29
38
impl < T : Ord > PriorityQueue < T > : Container {
30
39
/// Returns the length of the queue
31
40
pure fn len ( & self ) -> uint { self . data . len ( ) }
You can’t perform that action at this time.
0 commit comments