diff options
| author | blake2-ppc <blake2-ppc> | 2013-07-21 22:37:14 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-07-21 22:37:14 +0200 |
| commit | cf437a273033a16c4084acc07b1341ee86bd5bbd (patch) | |
| tree | 50f0a9cf374312af1dfcc263da0bc21326a1b228 /src/libextra/dlist.rs | |
| parent | 21adfd564555428d0af11e7f22b42e05698d74fd (diff) | |
| download | rust-cf437a273033a16c4084acc07b1341ee86bd5bbd.tar.gz rust-cf437a273033a16c4084acc07b1341ee86bd5bbd.zip | |
dlist: Remove extraneous unwrap in .pop_back_node()
Diffstat (limited to 'src/libextra/dlist.rs')
| -rw-r--r-- | src/libextra/dlist.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index 068dea7b8cc..a715d4aeeae 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -185,12 +185,12 @@ impl<T> DList<T> { /// Remove the last Node and return it, or None if the list is empty #[inline] fn pop_back_node(&mut self) -> Option<~Node<T>> { - do self.list_tail.resolve().map_consume |tail| { + do self.list_tail.resolve().map_consume_default(None) |tail| { self.length -= 1; self.list_tail = tail.prev; match tail.prev.resolve() { - None => self.list_head.take_unwrap(), - Some(tail_prev) => tail_prev.next.take_unwrap() + None => self.list_head.take(), + Some(tail_prev) => tail_prev.next.take() } } } |
