about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-10 07:49:45 -0800
committerAaron Turon <aturon@mozilla.com>2014-12-18 23:31:52 -0800
commit4ffd9f49c340c350080bfe6c1be9e3aaccd549d0 (patch)
tree23aff13e71e93fa2c73cea94bf6128f920220dfe /src/libstd/sys
parenta7061d02e16d0821d3af2b753155fe44bab7725c (diff)
downloadrust-4ffd9f49c340c350080bfe6c1be9e3aaccd549d0.tar.gz
rust-4ffd9f49c340c350080bfe6c1be9e3aaccd549d0.zip
Avoid .take().unwrap() with FnOnce closures
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/thread_info.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs
index 0612448cfa0..206d443d294 100644
--- a/src/libstd/sys/common/thread_info.rs
+++ b/src/libstd/sys/common/thread_info.rs
@@ -60,12 +60,11 @@ pub fn set_unwinding(unwinding: bool) {
 
 pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) {
     THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
-    let mut thread_opt = Some(thread); // option dance
-    THREAD_INFO.with(|c| *c.borrow_mut() = Some(ThreadInfo{
+    THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{
         stack_bounds: stack_bounds,
         stack_guard: stack_guard,
         unwinding: false,
-        thread: thread_opt.take().unwrap(),
+        thread: thread,
     }));
 }