-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider making Reader and Writer generic in their type of error #18414
Comments
It wouldn't be hard to convert most of the
This would give the ability to distinguish between errors caused be exceeding the limit and errors raised by the underlying reader by returning
|
In addition to the above: There are plenty of implementors of these traits that can only fail in one possible way. For these it would make sense to just use |
Hey @canndrew ! You should get involved over in rust-lang/rfcs#576 if this issue is still important to you, that's the right place to bring this up. Thank you! |
IoError
doesn't make sense for all kinds ofReader
andWriter
. Instead, implementors should be able to choose what they return using an associated type.For example, the
Reader
trait would look like this:The text was updated successfully, but these errors were encountered: