1
Fork 0

std: Remove io::io_error

* All I/O now returns IoResult<T> = Result<T, IoError>
* All formatting traits now return fmt::Result = IoResult<()>
* The if_ok!() macro was added to libstd
This commit is contained in:
Alex Crichton 2014-01-29 16:33:57 -08:00
parent be4fc63809
commit ece8a8f520
35 changed files with 918 additions and 1059 deletions

View file

@ -119,6 +119,7 @@ impl Task {
// Run the task main function, then do some cleanup.
f.finally(|| {
#[allow(unused_must_use)]
fn close_outputs() {
let mut task = Local::borrow(None::<Task>);
let logger = task.get().logger.take();
@ -126,8 +127,8 @@ impl Task {
let stdout = task.get().stdout.take();
drop(task);
drop(logger); // loggers are responsible for flushing
match stdout { Some(mut w) => w.flush(), None => {} }
match stderr { Some(mut w) => w.flush(), None => {} }
match stdout { Some(mut w) => { w.flush(); }, None => {} }
match stderr { Some(mut w) => { w.flush(); }, None => {} }
}
// First, flush/destroy the user stdout/logger because these