@@ -67,7 +67,11 @@ impl Parse {
67
67
Frame :: Bulk ( data) => str:: from_utf8 ( & data[ ..] )
68
68
. map ( |s| s. to_string ( ) )
69
69
. 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 ( ) ) ,
71
75
}
72
76
}
73
77
@@ -83,7 +87,11 @@ impl Parse {
83
87
// raw bytes, they are considered separate types.
84
88
Frame :: Simple ( s) => Ok ( Bytes :: from ( s. into_bytes ( ) ) ) ,
85
89
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 ( ) ) ,
87
95
}
88
96
}
89
97
@@ -135,13 +143,10 @@ impl From<&str> for ParseError {
135
143
impl fmt:: Display for ParseError {
136
144
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
137
145
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) ,
141
147
ParseError :: Other ( err) => err. fmt ( f) ,
142
148
}
143
149
}
144
150
}
145
151
146
- impl std:: error:: Error for ParseError {
147
- }
152
+ impl std:: error:: Error for ParseError { }
0 commit comments