File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1677,6 +1677,15 @@ impl error::Error for TryRecvError {
16771677 }
16781678}
16791679
1680+ #[ stable( feature = "mpsc_recv_error_from" , since = "1.23.0" ) ]
1681+ impl From < RecvError > for TryRecvError {
1682+ fn from ( err : RecvError ) -> TryRecvError {
1683+ match err {
1684+ RecvError => TryRecvError :: Disconnected ,
1685+ }
1686+ }
1687+ }
1688+
16801689#[ stable( feature = "mpsc_recv_timeout_error" , since = "1.15.0" ) ]
16811690impl fmt:: Display for RecvTimeoutError {
16821691 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
@@ -1709,6 +1718,15 @@ impl error::Error for RecvTimeoutError {
17091718 }
17101719}
17111720
1721+ #[ stable( feature = "mpsc_recv_error_from" , since = "1.23.0" ) ]
1722+ impl From < RecvError > for RecvTimeoutError {
1723+ fn from ( err : RecvError ) -> RecvTimeoutError {
1724+ match err {
1725+ RecvError => RecvTimeoutError :: Disconnected ,
1726+ }
1727+ }
1728+ }
1729+
17121730#[ cfg( all( test, not( target_os = "emscripten" ) ) ) ]
17131731mod tests {
17141732 use env;
You can’t perform that action at this time.
0 commit comments