diff options
| author | Aaron Turon <aturon@mozilla.com> | 2016-12-14 13:02:00 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2016-12-16 19:42:17 -0800 |
| commit | 9a5cef4de51c1c90fb2d05b0c7e6feb9cf0224d6 (patch) | |
| tree | dfc7eb130baf656785761739b6808efdec694254 /src/libstd/io | |
| parent | fce6af2a6759991b8f31b6dcbee315ccacb2339d (diff) | |
| download | rust-9a5cef4de51c1c90fb2d05b0c7e6feb9cf0224d6.tar.gz rust-9a5cef4de51c1c90fb2d05b0c7e6feb9cf0224d6.zip | |
Address fallout
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/stdio.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 6419a9ff683..1a65bee13b8 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -10,7 +10,7 @@ use io::prelude::*; -use cell::{RefCell, BorrowState}; +use cell::RefCell; use fmt; use io::lazy::Lazy; use io::{self, BufReader, LineWriter}; @@ -638,8 +638,8 @@ pub fn _print(args: fmt::Arguments) { LocalKeyState::Destroyed => stdout().write_fmt(args), LocalKeyState::Valid => { LOCAL_STDOUT.with(|s| { - if s.borrow_state() == BorrowState::Unused { - if let Some(w) = s.borrow_mut().as_mut() { + if let Ok(mut borrowed) = s.try_borrow_mut() { + if let Some(w) = borrowed.as_mut() { return w.write_fmt(args); } } |
