diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-03 16:44:16 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-12-10 15:13:12 -0800 |
| commit | 786dea207d5b891d37e596e96dd2f84c4cb59f49 (patch) | |
| tree | f275936b26e6602b11363446fcac5ad3b09dbe92 /src/libstd/rt/kill.rs | |
| parent | 5aad292fb99f7e9a2730b35ed535bda0ab9c6117 (diff) | |
| download | rust-786dea207d5b891d37e596e96dd2f84c4cb59f49.tar.gz rust-786dea207d5b891d37e596e96dd2f84c4cb59f49.zip | |
libextra: Another round of de-`Cell`-ing.
34 uses of `Cell` remain.
Diffstat (limited to 'src/libstd/rt/kill.rs')
| -rw-r--r-- | src/libstd/rt/kill.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index 56c77ffaa0d..e3f9cd09632 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -151,7 +151,6 @@ There are two known issues with the current scheme for exit code propagation. */ use cast; -use cell::Cell; use option::{Option, Some, None}; use prelude::*; use rt::task::Task; @@ -256,8 +255,10 @@ impl Death { /// Collect failure exit codes from children and propagate them to a parent. pub fn collect_failure(&mut self, result: UnwindResult) { - let result = Cell::new(result); - self.on_exit.take().map(|on_exit| on_exit(result.take())); + match self.on_exit.take() { + None => {} + Some(on_exit) => on_exit(result), + } } /// Enter a possibly-nested "atomic" section of code. Just for assertions. |
