Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
3 tasks
Member
|
I wonder if we could just add a |
Member
Author
|
Thought of that, but it wouldn't work because |
Member
|
@ibraheemdev Oh, you're right; we probably can't support a general In that case, I think this is a fine shortcut to add and experiment with. @bors r+ rollup |
Collaborator
|
📌 Commit 85f786c has been approved by |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 15, 2021
…riplett Add `io::Error::other` This PR adds a small utility constructor, `io::Error::other`, a shorthand for `io::Error::new(io::ErrorKind::Other, err)`, something I find myself writing often. For some concrete stats, a quick search on [grep.app](https://grep.app) shows that more than half of the uses of `io::Error::new` use `ErrorKind::Other`: ``` Error::new\((?:std::)?(?:io::)?ErrorKind:: => 3,898 results Error::new\((?:std::)?(?:io::)?ErrorKind::Other => 2,186 results ```
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 16, 2021
…riplett Add `io::Error::other` This PR adds a small utility constructor, `io::Error::other`, a shorthand for `io::Error::new(io::ErrorKind::Other, err)`, something I find myself writing often. For some concrete stats, a quick search on [grep.app](https://grep.app) shows that more than half of the uses of `io::Error::new` use `ErrorKind::Other`: ``` Error::new\((?:std::)?(?:io::)?ErrorKind:: => 3,898 results Error::new\((?:std::)?(?:io::)?ErrorKind::Other => 2,186 results ```
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 16, 2021
…riplett Add `io::Error::other` This PR adds a small utility constructor, `io::Error::other`, a shorthand for `io::Error::new(io::ErrorKind::Other, err)`, something I find myself writing often. For some concrete stats, a quick search on [grep.app](https://grep.app) shows that more than half of the uses of `io::Error::new` use `ErrorKind::Other`: ``` Error::new\((?:std::)?(?:io::)?ErrorKind:: => 3,898 results Error::new\((?:std::)?(?:io::)?ErrorKind::Other => 2,186 results ```
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 16, 2021
…riplett Add `io::Error::other` This PR adds a small utility constructor, `io::Error::other`, a shorthand for `io::Error::new(io::ErrorKind::Other, err)`, something I find myself writing often. For some concrete stats, a quick search on [grep.app](https://grep.app) shows that more than half of the uses of `io::Error::new` use `ErrorKind::Other`: ``` Error::new\((?:std::)?(?:io::)?ErrorKind:: => 3,898 results Error::new\((?:std::)?(?:io::)?ErrorKind::Other => 2,186 results ```
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 16, 2021
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#91172 (Warn when a `#[test]`-like built-in attribute macro is present multiple times.) - rust-lang#91796 (Fix since attribute for const_manually_drop feature) - rust-lang#91879 (Remove `in_band_lifetimes` from `rustc_borrowck`) - rust-lang#91947 (Add `io::Error::other`) - rust-lang#91967 (Pull in libdevstat on FreeBSD) - rust-lang#91987 (Add module documentation for rustdoc passes) - rust-lang#92001 (Fix default_method_body_is_const when used across crates) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a small utility constructor,
io::Error::other, a shorthand forio::Error::new(io::ErrorKind::Other, err), something I find myself writing often.For some concrete stats, a quick search on grep.app shows that more than half of the uses of
io::Error::newuseErrorKind::Other: