File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ url = "0.5.0"
2424rustc-serialize = " 0.3.16"
2525bitflags = " 0.3.3"
2626rand = " 0.3.12"
27- byteorder = " 0.4.2 "
27+ byteorder = " 0.5.1 "
2828net2 = " 0.2.17"
2929
3030[features ]
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ use std::fmt;
88use openssl:: ssl:: error:: SslError ;
99use hyper:: Error as HttpError ;
1010use url:: ParseError ;
11- use byteorder;
1211
1312/// The type used for WebSocket results
1413pub type WebSocketResult < T > = Result < T , WebSocketError > ;
@@ -80,6 +79,9 @@ impl Error for WebSocketError {
8079
8180impl From < io:: Error > for WebSocketError {
8281 fn from ( err : io:: Error ) -> WebSocketError {
82+ if err. kind ( ) == io:: ErrorKind :: UnexpectedEof {
83+ return WebSocketError :: NoDataAvailable ;
84+ }
8385 WebSocketError :: IoError ( err)
8486 }
8587}
@@ -108,15 +110,6 @@ impl From<Utf8Error> for WebSocketError {
108110 }
109111}
110112
111- impl From < byteorder:: Error > for WebSocketError {
112- fn from ( err : byteorder:: Error ) -> WebSocketError {
113- match err {
114- byteorder:: Error :: UnexpectedEOF => WebSocketError :: NoDataAvailable ,
115- byteorder:: Error :: Io ( err) => From :: from ( err)
116- }
117- }
118- }
119-
120113impl From < WSUrlErrorKind > for WebSocketError {
121114 fn from ( err : WSUrlErrorKind ) -> WebSocketError {
122115 WebSocketError :: WebSocketUrlError ( err)
You can’t perform that action at this time.
0 commit comments