Skip to content

Commit 759517c

Browse files
committed
auto merge of #14417 : Sawyer47/rust/dlist-fixme, r=huonw
Issue #3511 was closed, but dlist.rs contained a FIXME for it.
2 parents 489f470 + 9b5bdfc commit 759517c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/libcollections/dlist.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,13 @@ impl<T> Deque<T> for DList<T> {
220220
/// Provide a reference to the back element, or None if the list is empty
221221
#[inline]
222222
fn back<'a>(&'a self) -> Option<&'a T> {
223-
let tmp = self.list_tail.resolve_immut(); // FIXME: #3511: shouldn't need variable
224-
tmp.as_ref().map(|tail| &tail.value)
223+
self.list_tail.resolve_immut().as_ref().map(|tail| &tail.value)
225224
}
226225

227226
/// Provide a mutable reference to the back element, or None if the list is empty
228227
#[inline]
229228
fn back_mut<'a>(&'a mut self) -> Option<&'a mut T> {
230-
let tmp: Option<&'a mut Node<T>> =
231-
self.list_tail.resolve(); // FIXME: #3511: shouldn't need variable
232-
tmp.map(|tail| &mut tail.value)
229+
self.list_tail.resolve().map(|tail| &mut tail.value)
233230
}
234231

235232
/// Add an element first in the list
@@ -449,8 +446,7 @@ impl<'a, A> DoubleEndedIterator<&'a A> for Items<'a, A> {
449446
if self.nelem == 0 {
450447
return None;
451448
}
452-
let tmp = self.tail.resolve_immut(); // FIXME: #3511: shouldn't need variable
453-
tmp.as_ref().map(|prev| {
449+
self.tail.resolve_immut().as_ref().map(|prev| {
454450
self.nelem -= 1;
455451
self.tail = prev.prev;
456452
&prev.value

0 commit comments

Comments
 (0)