File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1267,6 +1267,38 @@ impl error::Error for TryRecvError {
12671267 }
12681268}
12691269
1270+ #[ stable( feature = "mpsc_recv_timeout_error" , since = "1.14.0" ) ]
1271+ impl fmt:: Display for RecvTimeoutError {
1272+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1273+ match * self {
1274+ RecvTimeoutError :: Timeout => {
1275+ "timed out waiting on channel" . fmt ( f)
1276+ }
1277+ RecvTimeoutError :: Disconnected => {
1278+ "channel is empty and sending half is closed" . fmt ( f)
1279+ }
1280+ }
1281+ }
1282+ }
1283+
1284+ #[ stable( feature = "mpsc_recv_timeout_error" , since = "1.14.0" ) ]
1285+ impl error:: Error for RecvTimeoutError {
1286+ fn description ( & self ) -> & str {
1287+ match * self {
1288+ RecvTimeoutError :: Timeout => {
1289+ "timed out waiting on channel"
1290+ }
1291+ RecvTimeoutError :: Disconnected => {
1292+ "channel is empty and sending half is closed"
1293+ }
1294+ }
1295+ }
1296+
1297+ fn cause ( & self ) -> Option < & error:: Error > {
1298+ None
1299+ }
1300+ }
1301+
12701302#[ cfg( all( test, not( target_os = "emscripten" ) ) ) ]
12711303mod tests {
12721304 use env;
You can’t perform that action at this time.
0 commit comments