@@ -67,7 +67,11 @@ impl Parse {
6767 Frame :: Bulk ( data) => str:: from_utf8 ( & data[ ..] )
6868 . map ( |s| s. to_string ( ) )
6969 . map_err ( |_| "protocol error; invalid string" . into ( ) ) ,
70- frame => Err ( format ! ( "protocol error; expected simple frame or bulk frame, got {:?}" , frame) . into ( ) ) ,
70+ frame => Err ( format ! (
71+ "protocol error; expected simple frame or bulk frame, got {:?}" ,
72+ frame
73+ )
74+ . into ( ) ) ,
7175 }
7276 }
7377
@@ -83,7 +87,11 @@ impl Parse {
8387 // raw bytes, they are considered separate types.
8488 Frame :: Simple ( s) => Ok ( Bytes :: from ( s. into_bytes ( ) ) ) ,
8589 Frame :: Bulk ( data) => Ok ( data) ,
86- frame => Err ( format ! ( "protocol error; expected simple frame or bulk frame, got {:?}" , frame) . into ( ) ) ,
90+ frame => Err ( format ! (
91+ "protocol error; expected simple frame or bulk frame, got {:?}" ,
92+ frame
93+ )
94+ . into ( ) ) ,
8795 }
8896 }
8997
@@ -135,13 +143,10 @@ impl From<&str> for ParseError {
135143impl fmt:: Display for ParseError {
136144 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
137145 match self {
138- ParseError :: EndOfStream => {
139- "protocol error; unexpected end of stream" . fmt ( f)
140- }
146+ ParseError :: EndOfStream => "protocol error; unexpected end of stream" . fmt ( f) ,
141147 ParseError :: Other ( err) => err. fmt ( f) ,
142148 }
143149 }
144150}
145151
146- impl std:: error:: Error for ParseError {
147- }
152+ impl std:: error:: Error for ParseError { }
0 commit comments