File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ impl<T: AsyncRead + AsyncWrite> Buffered<T> {
7272 match self . read_from_io ( ) {
7373 Ok ( 0 ) => {
7474 trace ! ( "parse eof" ) ;
75- return Err ( io:: Error :: new ( io:: ErrorKind :: UnexpectedEof , "parse eof" ) . into ( ) ) ;
75+ //TODO: With Rust 1.14, this can be Error::from(ErrorKind)
76+ return Err ( io:: Error :: new ( io:: ErrorKind :: UnexpectedEof , ParseEof ) . into ( ) ) ;
7677 }
7778 Ok ( _) => { } ,
7879 Err ( e) => match e. kind ( ) {
@@ -316,6 +317,21 @@ impl WriteBuf {
316317 }
317318}
318319
320+ #[ derive( Debug ) ]
321+ struct ParseEof ;
322+
323+ impl fmt:: Display for ParseEof {
324+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
325+ f. write_str ( "parse eof" )
326+ }
327+ }
328+
329+ impl :: std:: error:: Error for ParseEof {
330+ fn description ( & self ) -> & str {
331+ "parse eof"
332+ }
333+ }
334+
319335#[ cfg( test) ]
320336use std:: io:: Read ;
321337
You can’t perform that action at this time.
0 commit comments