diff --git a/src/native/delay.rs b/src/native/delay.rs index 69e8fcd..22b7084 100644 --- a/src/native/delay.rs +++ b/src/native/delay.rs @@ -116,7 +116,7 @@ impl Future for Delay { return Poll::Ready(()); } - state.waker.register(&cx.waker()); + state.waker.register(cx.waker()); // Now that we've registered, do the full check of our own internal // state. If we've fired the first bit is set, and if we've been diff --git a/src/native/heap.rs b/src/native/heap.rs index dca0b19..4c31482 100644 --- a/src/native/heap.rs +++ b/src/native/heap.rs @@ -66,7 +66,7 @@ impl Heap { pub fn peek(&self) -> Option<&T> { self.assert_consistent(); - self.items.get(0).map(|i| &i.0) + self.items.first().map(|i| &i.0) } pub fn pop(&mut self) -> Option { @@ -191,7 +191,7 @@ impl Heap { } } - for (i, &(ref item, _)) in self.items.iter().enumerate() { + for (i, (item, _)) in self.items.iter().enumerate() { if i > 0 { assert!(*item >= self.items[(i - 1) / 2].0, "bad at index: {}", i); } @@ -272,7 +272,7 @@ mod tests { for t in v { h.push(t); } - return h; + h } #[test]