about summary refs log tree commit diff
path: root/src/libgreen/stack.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-02-23 10:56:38 +1100
committerAlex Crichton <alex@alexcrichton.com>2014-02-24 21:22:26 -0800
commit16e635cdfbb6b041886d1bccd28fa5e7e34c9f47 (patch)
treeeae398f604ca7c7798707ec1fd935fef79a0a493 /src/libgreen/stack.rs
parent3ca01676bcbd092b04608cc0eee843b7031e46cb (diff)
downloadrust-16e635cdfbb6b041886d1bccd28fa5e7e34c9f47.tar.gz
rust-16e635cdfbb6b041886d1bccd28fa5e7e34c9f47.zip
std: make .swap_remove return Option<T>.
This is one of the last raw "indexing" method on vectors that returns
`T` instead of the Option.
Diffstat (limited to 'src/libgreen/stack.rs')
-rw-r--r--src/libgreen/stack.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libgreen/stack.rs b/src/libgreen/stack.rs
index 8a5e6be17c8..053d73c010e 100644
--- a/src/libgreen/stack.rs
+++ b/src/libgreen/stack.rs
@@ -139,7 +139,7 @@ impl StackPool {
     pub fn take_stack(&mut self, min_size: uint) -> Stack {
         // Ideally this would be a binary search
         match self.stacks.iter().position(|s| min_size <= s.min_size) {
-            Some(idx) => self.stacks.swap_remove(idx),
+            Some(idx) => self.stacks.swap_remove(idx).unwrap(),
             None => Stack::new(min_size)
         }
     }