Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove io::io_error #11946

Merged
merged 18 commits into from
Feb 3, 2014
Merged

Remove io::io_error #11946

merged 18 commits into from
Feb 3, 2014

Conversation

alexcrichton
Copy link
Member

Turns out this was a little more far-reaching than I thought it was.

The first commit is the crux of this stack of commits. The io::io_error condition is completely removed and the read and write methods are altered to return IoResult<T>. This turned out to be an incredibly far-reaching change!

Overall, I'm very happy with how this turned out (in addition with the unused_must_use lint). I had to almost rewrite the pretty printer in libsyntax as well as the the formatting in librustdoc (as one would expect). These two modules do tons of I/O, and I believe that it's definitely improved.

This pull request also introduces the if_ok!() macro for returning-early from something that returns a result. I made quite liberal use of this in mostly the pretty printer and html renderer, and I found its usage generally quite pleasant and convenient to have. I didn't really feel like adding any other macro while I was using it, and I figured that pretty printing could be nicer, but it's nowhere near horrid today.

This may be a controversial issue closing, but I'm going to say it.

Closes #6163

@sfackler
Copy link
Member

Needs a rebase already!

@olsonjeffery
Copy link
Contributor

plays taps

// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Implementations of I/O traits for the Option type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is outdated.

@flaper87
Copy link
Contributor

awesome work!

@emberian
Copy link
Member

emberian commented Feb 3, 2014

Hoo boy, that's a biggun!

bors added a commit that referenced this pull request Feb 3, 2014
Turns out this was a little more far-reaching than I thought it was.

The first commit is the crux of this stack of commits. The `io::io_error` condition is completely removed and the `read` and `write` methods are altered to return `IoResult<T>`. This turned out to be an incredibly far-reaching change!

Overall, I'm very happy with how this turned out (in addition with the `unused_must_use` lint). I had to almost rewrite the pretty printer in `libsyntax` as well as the the formatting in `librustdoc` (as one would expect). These two modules do *tons* of I/O, and I believe that it's definitely improved.

This pull request also introduces the `if_ok!()` macro for returning-early from something that returns a result. I made quite liberal use of this in mostly the pretty printer and html renderer, and I found its usage generally quite pleasant and convenient to have. I didn't really feel like adding any other macro while I was using it, and I figured that pretty printing could be nicer, but it's nowhere near horrid today.

This may be a controversial issue closing, but I'm going to say it.

Closes #6163
@bors bors closed this Feb 3, 2014
@bors bors merged commit c765a8e into rust-lang:master Feb 3, 2014
@alexcrichton alexcrichton deleted the no-io-error branch February 5, 2014 00:09
cadencemarseille added a commit to cadencemarseille/rust-pcre that referenced this pull request Feb 9, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 28, 2023
…r=blyxyas,xFrednet

fix: broken GitHub corner

changelog: none

fixes rust-lang#11946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Design and implement I/O error handling strategy
7 participants