about summary refs log tree commit diff
path: root/src/libstd/io/stdio.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-15 23:36:58 -0700
committerbors <bors@rust-lang.org>2014-04-15 23:36:58 -0700
commit349d66af9420eeeeedfc648eb6ec3fd28015d4b3 (patch)
tree9789ea9a2b13b61b570bd896fe203a36bc08103c /src/libstd/io/stdio.rs
parent74bd2338eb25d0d165458a09d7aab3d2ecb98c48 (diff)
parentc18c9284b352f3605553343cd78c7a8eb75b5cd2 (diff)
auto merge of #13532 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/io/stdio.rs')
-rw-r--r--src/libstd/io/stdio.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs
index 5f47e227901..34a57884398 100644
--- a/src/libstd/io/stdio.rs
+++ b/src/libstd/io/stdio.rs
@@ -160,7 +160,7 @@ fn reset_helper(w: ~Writer:Send,
 {
     let mut t = Local::borrow(None::<Task>);
     // Be sure to flush any pending output from the writer
-    match f(t.get(), w) {
+    match f(&mut *t, w) {
         Some(mut w) => {
             drop(t);
             // FIXME: is failing right here?
@@ -230,9 +230,7 @@ fn with_task_stdout(f: |&mut Writer| -> IoResult<()> ) {
             // To protect against this, we do a little dance in which we
             // temporarily take the task, swap the handles, put the task in TLS,
             // and only then drop the previous handle.
-            let mut t = Local::borrow(None::<Task>);
-            let prev = replace(&mut t.get().stdout, my_stdout);
-            drop(t);
+            let prev = replace(&mut Local::borrow(None::<Task>).stdout, my_stdout);
             drop(prev);
             ret
         }