From f77cabecbba8d842cd944b064065ad4e6a6b760d Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Mon, 11 Aug 2014 16:47:46 -0700 Subject: Deprecation fallout in libcollections --- src/libcollections/priority_queue.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libcollections/priority_queue.rs') 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 PriorityQueue { /// /// ``` 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 PriorityQueue { 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 PriorityQueue { 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()); -- cgit 1.4.1-3-g733a5