File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ we won't provide support for error responses:
172
172
fn encode (& mut self , msg : String , buf : & mut Vec <u8 >)
173
173
-> io :: Result <()>
174
174
{
175
- buf . extend_from_slice (msg . as_bytes ());
175
+ buf . extend (msg . as_bytes ());
176
176
buf . push (b '\ n ' );
177
177
Ok (())
178
178
}
Original file line number Diff line number Diff line change @@ -146,8 +146,8 @@ impl Codec for LineCodec {
146
146
let mut encoded_id = [0 ; 4 ];
147
147
BigEndian :: write_u32 (& mut encoded_id , id as u32 );
148
148
149
- buf . extend_from_slice (& encoded_id );
150
- buf . extend_from_slice (msg . as_bytes ());
149
+ buf . extend (& encoded_id );
150
+ buf . extend (msg . as_bytes ());
151
151
buf . push (b '\ n ' );
152
152
153
153
Ok (())
Original file line number Diff line number Diff line change @@ -184,11 +184,11 @@ impl Codec for LineCodec {
184
184
// includes a streaming body is an empty string.
185
185
assert! (message . is_empty () == body );
186
186
187
- buf . extend_from_slice (message . as_bytes ());
187
+ buf . extend (message . as_bytes ());
188
188
}
189
189
Frame :: Body { chunk } => {
190
190
if let Some (chunk ) = chunk {
191
- buf . extend_from_slice (chunk . as_bytes ());
191
+ buf . extend (chunk . as_bytes ());
192
192
}
193
193
}
194
194
Frame :: Error { error } => {
You can’t perform that action at this time.
0 commit comments