3

`impl Display for io::ErrorKind` by jyn514 · Pull Request #93090 · rust-lang/rus...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/93090
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Member

jyn514 commented 10 days ago

This avoids having to convert from ErrorKind to Error just to print the error message.

Copy link

Collaborator

rust-highfive commented 10 days ago

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

Copy link

Member

Author

jyn514 commented 10 days ago

FYI @pietroalbini I still seem to have various github permissions even after leaving the rustdoc team, you might want into look into the automation for that.

impl fmt::Display for ErrorKind {

/// Shows a human-readable description of the `ErrorKind`.

///

/// This is similar to `impl Display for Error`, but doesn't require the error to be allocated on the heap.

Copy link

Member

Author

@jyn514 jyn514 10 days ago

I realized after writing this that the comment is wrong and this impl is less useful than I thought, because impl From<ErrorKind> for Error doesn't allocate. But this still seems like a useful change even so to avoid noise.

m-ou-se reacted with thumbs up emoji

Copy link

Member

joshtriplett commented 10 days ago

This seems reasonable to me.

@rfcbot merge

Copy link

rfcbot commented 10 days ago

edited by yaahc

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

Copy link

rfcbot commented 10 days ago

bellThis is now entering its final comment period, as per the review above. bell

Copy link

Contributor

ChrisDenton commented 10 days ago

Aside: This makes me wonder if it might make sense to implement PartialEq<io::ErrorKind> for io::Error.

Copy link

Member

joshtriplett commented 10 days ago

edited

@ChrisDenton That seems like a great idea, and it might substantially simplify error handling code that needs to check for specific cases.

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Projects

None yet

Milestone

No milestone

Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK