about summary refs log tree commit diff
path: root/src/libcollections/priority_queue.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-08-12 22:01:25 +0000
committerbors <bors@rust-lang.org>2014-08-12 22:01:25 +0000
commit51c7e20d539eaed6e765612a02fbf2865e08a1bc (patch)
tree5b1dcf1dee9cdc745b0d01c0d26295f05a97d04d /src/libcollections/priority_queue.rs
parent4bb4a43917bf702fb2c6a614786aa1abe6c1014c (diff)
parentd7484b86fc8936d670c168c9838e188e1bc8047a (diff)
auto merge of #16433 : aturon/rust/deprecated-in-crate, r=alexcrichton
Previously the stability lint considered cross-crate items only. That's appropriate for unstable and experimental levels, but not for deprecation.

In addition to changing the lint, this PR takes care of the fallout: a number of deprecated items that were being used throughout libstd.

Closes #16409

Due to deny(deprecated), this is a:

[breaking-change]
Diffstat (limited to 'src/libcollections/priority_queue.rs')
-rw-r--r--src/libcollections/priority_queue.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcollections/priority_queue.rs b/src/libcollections/priority_queue.rs
index bf2c8c83d87..a88a833c9ed 100644
--- a/src/libcollections/priority_queue.rs
+++ b/src/libcollections/priority_queue.rs
@@ -261,7 +261,7 @@ impl<T: Ord> PriorityQueue<T> {
     ///
     /// ```
     pub fn top<'a>(&'a self) -> Option<&'a T> {
-        if self.is_empty() { None } else { Some(self.data.get(0)) }
+        if self.is_empty() { None } else { Some(&self.data[0]) }
     }
 
     #[deprecated="renamed to `top`"]
@@ -473,7 +473,7 @@ impl<T: Ord> PriorityQueue<T> {
 
             while pos > start {
                 let parent = (pos - 1) >> 1;
-                if new > *self.data.get(parent) {
+                if new > self.data[parent] {
                     let x = replace(self.data.get_mut(parent), zeroed());
                     ptr::write(self.data.get_mut(pos), x);
                     pos = parent;
@@ -493,7 +493,7 @@ impl<T: Ord> PriorityQueue<T> {
             let mut child = 2 * pos + 1;
             while child < end {
                 let right = child + 1;
-                if right < end && !(*self.data.get(child) > *self.data.get(right)) {
+                if right < end && !(self.data[child] > self.data[right]) {
                     child = right;
                 }
                 let x = replace(self.data.get_mut(child), zeroed());