From 6a90e80b6240d8213f2b99fa470ef6ee04552d1b Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 20 Sep 2013 02:08:47 -0400 Subject: option: rewrite the API to use composition --- src/libstd/rt/kill.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libstd/rt/kill.rs') diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index 09f99b9302e..6043ae318fe 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -486,10 +486,10 @@ impl KillHandle { || { // Prefer to check tombstones that were there first, // being "more fair" at the expense of tail-recursion. - others.take().map_move_default(true, |f| f()) && { + others.take().map_default(true, |f| f()) && { let mut inner = this.take().unwrap(); (!inner.any_child_failed) && - inner.child_tombstones.take().map_move_default(true, |f| f()) + inner.child_tombstones.take().map_default(true, |f| f()) } } } @@ -508,7 +508,7 @@ impl KillHandle { let others = Cell::new(other_tombstones); // :( || { // Prefer fairness to tail-recursion, as in above case. - others.take().map_move_default(true, |f| f()) && + others.take().map_default(true, |f| f()) && f.take()() } } @@ -577,7 +577,7 @@ impl Death { { use util; util::ignore(group); } // Step 1. Decide if we need to collect child failures synchronously. - do self.on_exit.take().map_move |on_exit| { + do self.on_exit.take().map |on_exit| { if success { // We succeeded, but our children might not. Need to wait for them. let mut inner = self.kill_handle.take_unwrap().unwrap(); @@ -585,7 +585,7 @@ impl Death { success = false; } else { // Lockless access to tombstones protected by unwrap barrier. - success = inner.child_tombstones.take().map_move_default(true, |f| f()); + success = inner.child_tombstones.take().map_default(true, |f| f()); } } on_exit(success); @@ -594,12 +594,12 @@ impl Death { // Step 2. Possibly alert possibly-watching parent to failure status. // Note that as soon as parent_handle goes out of scope, the parent // can successfully unwrap its handle and collect our reported status. - do self.watching_parent.take().map_move |mut parent_handle| { + do self.watching_parent.take().map |mut parent_handle| { if success { // Our handle might be None if we had an exit callback, and // already unwrapped it. But 'success' being true means no // child failed, so there's nothing to do (see below case). - do self.kill_handle.take().map_move |own_handle| { + do self.kill_handle.take().map |own_handle| { own_handle.reparent_children_to(&mut parent_handle); }; } else { -- cgit 1.4.1-3-g733a5