about summary refs log tree commit diff
path: root/src/libcollections/priority_queue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcollections/priority_queue.rs')
-rw-r--r--src/libcollections/priority_queue.rs21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/libcollections/priority_queue.rs b/src/libcollections/priority_queue.rs
index 65fd8ce4f54..885b5c99c45 100644
--- a/src/libcollections/priority_queue.rs
+++ b/src/libcollections/priority_queue.rs
@@ -159,7 +159,6 @@ use core::default::Default;
 use core::mem::{zeroed, replace, swap};
 use core::ptr;
 
-use {Mutable, MutableSeq};
 use slice;
 use vec::Vec;
 
@@ -171,16 +170,6 @@ pub struct PriorityQueue<T> {
     data: Vec<T>,
 }
 
-impl<T: Ord> Collection for PriorityQueue<T> {
-    /// Returns the length of the queue.
-    fn len(&self) -> uint { self.data.len() }
-}
-
-impl<T: Ord> Mutable for PriorityQueue<T> {
-    /// Drops all items from the queue.
-    fn clear(&mut self) { self.data.truncate(0) }
-}
-
 impl<T: Ord> Default for PriorityQueue<T> {
     #[inline]
     fn default() -> PriorityQueue<T> { PriorityQueue::new() }
@@ -504,6 +493,15 @@ impl<T: Ord> PriorityQueue<T> {
         let len = self.len();
         self.siftdown_range(pos, len);
     }
+
+    /// Returns the length of the queue.
+    pub fn len(&self) -> uint { self.data.len() }
+
+    /// Returns true if the queue contains no elements
+    pub fn is_empty(&self) -> bool { self.len() == 0 }
+
+    /// Drops all items from the queue.
+    pub fn clear(&mut self) { self.data.truncate(0) }
 }
 
 /// `PriorityQueue` iterator.
@@ -545,7 +543,6 @@ mod tests {
 
     use priority_queue::PriorityQueue;
     use vec::Vec;
-    use MutableSeq;
 
     #[test]
     fn test_iterator() {