Skip to content

Add io::Error doc examples #35109

New issue

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

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

Already on GitHub? # to your account

Merged
merged 6 commits into from
Aug 5, 2016
Merged

Add io::Error doc examples #35109

merged 6 commits into from
Aug 5, 2016

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jul 29, 2016

Fixes #29359.

r? @steveklabnik

/// print_os_error(&Error::last_os_error());
/// // Will print "Not an OS error".
/// print_os_error(&Error::new(ErrorKind::Other, "oh no!"));
/// }
Copy link
Member

@nagisa nagisa Jul 29, 2016

Choose a reason for hiding this comment

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

This example is weirdly indirect. Why not just println!("last OS error code: {:?}", Error::last_os_error().raw_os_error())

Copy link
Member Author

Choose a reason for hiding this comment

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

To show the difference between the two types of error mainly.

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 3, 2016

📌 Commit fda473f has been approved by steveklabnik

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 4, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Aug 4, 2016
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 5, 2016
bors added a commit that referenced this pull request Aug 5, 2016
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 5, 2016
bors added a commit that referenced this pull request Aug 5, 2016
@bors bors merged commit fda473f into rust-lang:master Aug 5, 2016
@GuillaumeGomez GuillaumeGomez deleted the io_docs branch August 6, 2016 11:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants