Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upConsider making Reader and Writer generic in their type of error #18414
Comments
This comment has been minimized.
This comment has been minimized.
|
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
|
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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! |
canndrew commentedOct 29, 2014
IoErrordoesn't make sense for all kinds ofReaderandWriter. Instead, implementors should be able to choose what they return using an associated type.For example, the
Readertrait would look like this: