Normalize timeout ErrorKind::WouldBlock to be TimedOut (#131)

`set_read_timeout` and `set_write_timeout` can cause `ErrorKind::WouldBlock` on unix-y platforms.

This PR normalizes those cases to `ErrorKind::TimedOut`. This will make it simpler higher up in the
stack to deal with timeouts.
This commit is contained in:
Martin Algesten authored and GitHub committed 2020-08-07 10:06:56 -07:00
1 parent 22d815e5e7
commit db4cc90956
2 files changed
+15 -6

No files matched your search

-1
View File
@@ -32,7 +32,6 @@ fn get_and_expect_timeout(url: String) {
match resp.into_string() {
Err(io_error) => match io_error.kind() {
io::ErrorKind::WouldBlock => Ok(()),
io::ErrorKind::TimedOut => Ok(()),
_ => Err(format!("{:?}", io_error)),
},