File tree 1 file changed +18
-0
lines changed
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 {
1677
1677
}
1678
1678
}
1679
1679
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
+
1680
1689
#[ stable( feature = "mpsc_recv_timeout_error" , since = "1.15.0" ) ]
1681
1690
impl fmt:: Display for RecvTimeoutError {
1682
1691
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
@@ -1709,6 +1718,15 @@ impl error::Error for RecvTimeoutError {
1709
1718
}
1710
1719
}
1711
1720
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
+
1712
1730
#[ cfg( all( test, not( target_os = "emscripten" ) ) ) ]
1713
1731
mod tests {
1714
1732
use env;
You can’t perform that action at this time.
0 commit comments