`impl Display for io::ErrorKind` by jyn514 · Pull Request #93090 · rust-lang/rus...
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.
Conversation
This avoids having to convert from ErrorKind
to Error
just to print the error message.
(rust-highfive has picked a reviewer for you, use r? to override)
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.
Outdated
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.
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.
This seems reasonable to me.
@rfcbot merge
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
This is now entering its final comment period, as per the review above.
Aside: This makes me wonder if it might make sense to implement PartialEq<io::ErrorKind>
for io::Error
.
@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
No reviews
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK