Skip to content

Commit

Permalink
Rename to_vec and to_sorted_vec
Browse files Browse the repository at this point in the history
  • Loading branch information
aochagavia committed May 18, 2014
1 parent 8e9567d commit 2b06105
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/libcollections/priority_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ impl<T: TotalOrd> PriorityQueue<T> {
item
}

#[deprecated="renamed to `into_vec`"]
fn to_vec(self) -> Vec<T> { self.into_vec() }

#[deprecated="renamed to `into_sorted_vec`"]
fn to_sorted_vec(self) -> Vec<T> { self.into_sorted_vec() }

/// Consume the PriorityQueue and return the underlying vector
pub fn to_vec(self) -> Vec<T> { let PriorityQueue{data: v} = self; v }
pub fn into_vec(self) -> Vec<T> { let PriorityQueue{data: v} = self; v }

/// Consume the PriorityQueue and return a vector in sorted
/// (ascending) order
pub fn to_sorted_vec(self) -> Vec<T> {
pub fn into_sorted_vec(self) -> Vec<T> {
let mut q = self;
let mut end = q.len();
while end > 1 {
Expand Down

0 comments on commit 2b06105

Please sign in to comment.