5
Add `io::Error::other` by ibraheemdev · Pull Request #91947 · rust-lang/rust · G...
source link: https://github.com/rust-lang/rust/pull/91947
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.
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 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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK