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
2020-08-07 19:06:56 +02:00
committed by GitHub
parent 22d815e5e7
commit db4cc90956
2 changed files with 15 additions and 6 deletions

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)),
},