Lint on code calling io::Error::new with io::ErrorKind::Other as the kind argument, because you can replace it with a call to io::Error::other.
Advantage
More concise
Drawbacks
Adding this lint would require people to change their code, adding work (though this should be machine-applicable) and adding diff churn to repository histories.
What it does
Lint on code calling
io::Error::new
withio::ErrorKind::Other
as thekind
argument, because you can replace it with a call toio::Error::other
.Advantage
More concise
Drawbacks
Adding this lint would require people to change their code, adding work (though this should be machine-applicable) and adding diff churn to repository histories.
Example
Could be written as:
(which then gets another lint to also cut out the closure, so the code is even simpler).