From 4ffd9f49c340c350080bfe6c1be9e3aaccd549d0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 10 Dec 2014 07:49:45 -0800 Subject: Avoid .take().unwrap() with FnOnce closures --- src/libstd/sys/common/thread_info.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libstd/sys/common') 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, })); } -- cgit 1.4.1-3-g733a5