File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ extern crate alloc;
99
1010macro_rules! invalid_data_error {
1111 ( $fmt: expr) => {
12- invalid_data_error! ( $fmt , "" )
12+ :: core2 :: io :: Error :: new ( :: core2 :: io :: ErrorKind :: InvalidData , $fmt )
1313 } ;
1414 ( $fmt: expr, $( $arg: tt) * ) => {
15- :: core2:: io:: Error :: new( :: core2:: io:: ErrorKind :: InvalidData , $fmt)
15+ :: core2:: io:: Error :: new( :: core2:: io:: ErrorKind :: InvalidData , format! ( $fmt, $ ( $arg ) * ) )
1616 } ;
1717}
1818
Original file line number Diff line number Diff line change @@ -932,4 +932,12 @@ mod tests {
932932 ] ;
933933 assert_eq ! ( buf, decoded_data) ;
934934 }
935+
936+ #[ test]
937+ fn issue_82 ( ) {
938+ let encoded_data = [ 0x00 , 0x00 ] ;
939+ let error = Header :: read_from ( & encoded_data[ ..] ) . unwrap_err ( ) ;
940+ assert_eq ! ( error. kind( ) , io:: ErrorKind :: InvalidData ) ;
941+ assert ! ( error. to_string( ) . contains( "method=0" ) ) ;
942+ }
935943}
You can’t perform that action at this time.
0 commit comments