rust/library/std/src/io
Matthias Krüger b742594f4a
Rollup merge of #91947 - ibraheemdev:io-error-other, r=joshtriplett
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
```
2021-12-16 17:23:10 +01:00
..
buffered implement review suggestions 2021-11-02 22:47:28 -07:00
cursor Make some std::io functions const 2020-11-06 17:48:26 +01:00
error Add test for io::Error::new_const. 2021-03-21 20:22:26 +01:00
impls std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
readbuf implement review suggestions 2021-11-02 22:47:28 -07:00
stdio stdio_locked: updates based on feedback 2021-07-02 15:56:56 -05:00
util read_buf 2021-11-02 22:47:20 -07:00
copy.rs fix test failure from trying to assume_init too much 2021-11-02 22:47:27 -07:00
cursor.rs read_buf 2021-11-02 22:47:20 -07:00
error.rs add io::Error::other constructor 2021-12-14 20:00:59 -05:00
impls.rs read_buf 2021-11-02 22:47:20 -07:00
mod.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
prelude.rs Use heading for std::prelude and not io::prelude 2021-01-05 17:52:24 -08:00
readbuf.rs correct typo 2021-12-07 22:09:14 -08:00
stdio.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
tests.rs read_buf 2021-11-02 22:47:20 -07:00
util.rs add safety comments 2021-11-02 22:47:26 -07:00