diff options
| author | Piotr Jawniak <sawyer47@gmail.com> | 2014-05-25 11:41:20 +0200 |
|---|---|---|
| committer | Piotr Jawniak <sawyer47@gmail.com> | 2014-05-25 11:41:20 +0200 |
| commit | 9b5bdfc2e2cb6928f9d592a3663fc8d090e5e3c6 (patch) | |
| tree | 6c59bc2ffffbf6af8a0988aefdee8eb4d766e1fd | |
| parent | 7d76d0ad44e1ec203d235f22eb3514247b8cbfe5 (diff) | |
| download | rust-9b5bdfc2e2cb6928f9d592a3663fc8d090e5e3c6.tar.gz rust-9b5bdfc2e2cb6928f9d592a3663fc8d090e5e3c6.zip | |
Fix FIXME #3511 in Dlist code
Issue #3511 was closed, but dlist.rs contained a FIXME for it.
| -rw-r--r-- | src/libcollections/dlist.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index c5fa8286f7d..8072ee02bc0 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -220,16 +220,13 @@ impl<T> Deque<T> for DList<T> { /// Provide a reference to the back element, or None if the list is empty #[inline] fn back<'a>(&'a self) -> Option<&'a T> { - let tmp = self.list_tail.resolve_immut(); // FIXME: #3511: shouldn't need variable - tmp.as_ref().map(|tail| &tail.value) + self.list_tail.resolve_immut().as_ref().map(|tail| &tail.value) } /// Provide a mutable reference to the back element, or None if the list is empty #[inline] fn back_mut<'a>(&'a mut self) -> Option<&'a mut T> { - let tmp: Option<&'a mut Node<T>> = - self.list_tail.resolve(); // FIXME: #3511: shouldn't need variable - tmp.map(|tail| &mut tail.value) + self.list_tail.resolve().map(|tail| &mut tail.value) } /// Add an element first in the list @@ -449,8 +446,7 @@ impl<'a, A> DoubleEndedIterator<&'a A> for Items<'a, A> { if self.nelem == 0 { return None; } - let tmp = self.tail.resolve_immut(); // FIXME: #3511: shouldn't need variable - tmp.as_ref().map(|prev| { + self.tail.resolve_immut().as_ref().map(|prev| { self.nelem -= 1; self.tail = prev.prev; &prev.value |
